Skip to content
/ CRF Public

Linear chain conditional random fields are implemented using Numpy and Mxnet/Gluon, and batch training is supported, not limited to training the data one by one.

License

Notifications You must be signed in to change notification settings

vanewu/CRF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conditional Random Field With Mxnet/Gluon

GitHub license CRF

Introduction

Linear chain conditional random fields are implemented using Numpy and Mxnet/Gluon, and batch training is supported, not limited to training the data one by one. The latest version of the code uses the foreach operation to perform the expansion of the sequence. The calculation uses NDArray for calculations as much as possible, so that the calculation can be accelerated on the GPU. The final test is more than 40 times faster than the previous calculation using the for loop, so the performance is effectively improved.

The forward calculation, backward calculation, Viterbi decoding, log maximum likelihood and other methods in the conditional random field are realized in crf.py. Finally, the CRF is designed as the layer of the neural network that can be reused in Mxet/Gluon. In order to directly interface with other network layers, such as LSTM + CRF.

Contents

  • crf.py (Source code for CRF implementation)
  • test.py  (Directly test whether CRF is available)
  • test_crf_layer.py (Place the CRF as a custom layer in other models and test for availability)

Reference

About

Linear chain conditional random fields are implemented using Numpy and Mxnet/Gluon, and batch training is supported, not limited to training the data one by one.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages