Browse Source

add nll loss

tags/v0.1.0
2017alan 6 years ago
parent
commit
8c13c28f0c
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      fastNLP/core/loss.py

+ 2
- 0
fastNLP/core/loss.py View File

@@ -37,5 +37,7 @@ class Loss(object):
"""
if loss_name == "cross_entropy":
return torch.nn.CrossEntropyLoss()
elif loss_name == 'nll':
return torch.nn.NLLLoss()
else:
raise NotImplementedError

Loading…
Cancel
Save