kmkurn / pytorch-crf

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

About model's output #49

Closed Foehnc closed 4 years ago

Foehnc commented 4 years ago

Can the output of the model be directly propagated as a loss?

kmkurn commented 4 years ago

By output you mean the output of decode? If so, then it depends on the loss function. decode is not differentiable w.r.t to the model's parameters. So, if you require the loss function to be differentiable (which normally you do since you're using pytorch), then no.

Foehnc commented 4 years ago

@kmkurn OK thx!