pytorch-crf
pytorch-crf copied to clipboard
(Linear-chain) Conditional random field in PyTorch.
self.all_crf_list:[CRF(num_tags=3), CRF(num_tags=13)] all_logits_list: [tensor([[[-3.9874e+36, 1.4790e+13, -3.9874e+36], [-3.9874e+36, -7.3833e+12, -3.9874e+36], [-3.9874e+36, -2.0520e+12, -3.9874e+36], ..., [-3.9874e+36, -2.2289e+12, -3.9874e+36], [-3.9874e+36, 3.4035e+12, -3.9874e+36], [-3.9874e+36, -4.3337e+12, -3.9874e+36]], [[-3.9874e+36, -2.3061e+12, -3.9874e+36], [-3.9874e+36, -5.0479e+12, -3.9874e+36], [-3.9874e+36, -6.4114e+12,...
I encounter an issue using crf layer when using a random mask, the loss becomes negative after several rounds. And I found this is due to the definition in https://github.com/kmkurn/pytorch-crf/blob/623e3402d00a2728e99d6e8486010d67c754267b/torchcrf/__init__.py#L203....
What's the difference between [pytorch-crf](https://github.com/kmkurn/pytorch-crf) and [TorchCRF](https://github.com/rikeda71/TorchCRF)?