nn.NLLLoss:负对数似然损失函数(Negative Log Likelihood)
nn.CrossEntropyLoss:交叉熵损失函数
两者关系:CrossEntropyLoss由NLLLoss和LogSoftMax结合而来。
具体理解推导公式过程如下:
参考:
https://zhuanlan.zhihu.com/p/98785902
https://www.cnblogs.com/jiashun/p/CrossEntropyLoss.html
https://www.cnblogs.com/leebxo/p/11913939.html
https://blog.csdn.net/weixin_36670529/article/details/105670337
对Pytorch中NLLLoss和CrossEntropyLoss的理解与推导
最新推荐文章于 2022-08-10 15:21:28 发布