kmkurn / pytorch-crf

(Linear-chain) Conditional random field in PyTorch.
https://pytorch-crf.readthedocs.io
MIT License
943 stars 152 forks source link

Allow parameters to be manually set #19

Closed JeppeHallgren closed 2 years ago

JeppeHallgren commented 6 years ago

Currently the only way to manually update the CRF state (such as start_transitions) is by accessing its internal memory directly (crf.start_transitions.data = my_new_parameters). Let's consider if there's a better way of achieving this - either through a setter function (see #18 ) or by allowing the parameters to be specified in the model constructor.