Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

6 lines (5 sloc) 425 Bytes

PyTorch Loss-Input Confusion (Cheatsheet)

  • torch.nn.functional.binary_cross_entropy takes logistic sigmoid values as inputs
  • torch.nn.functional.binary_cross_entropy_with_logits takes logits as inputs
  • torch.nn.functional.cross_entropy takes logits as inputs (performs log_softmax internally)
  • torch.nn.functional.nll_loss is like cross_entropy but takes log-probabilities (log-softmax) values as inputs
You can’t perform that action at this time.