log_softmax
log(softmax(X))
function:torch.nn.functional.log_softmax(x, dim=None)
nn:torch.nn.LogSoftmax(dim=None)
如:
nll_loss
The negative log likelihood loss
function:torch.nn.functional.nll_loss(input, target, weight=None, size_average=True, ignore_index=-100, reduce=None, reduction=‘elementwise_mean‘)
nn:torch.nn.NLLLoss(weight=None, size_average=True, ignore_index=-100, reduce=None, reduction=‘elementwise_mean‘)
如:
原文地址:https://www.cnblogs.com/sbj123456789/p/9532462.html
时间: 2024-10-08 16:45:37