0
点赞
收藏
分享

微信扫一扫

torch nn模块API介绍

CrossEntropyLoss

类原型:

torch.nn.CrossEntropyLoss(weight=None, 
	size_average=None, 
	ignore_index=- 100, 
	reduce=None, 
	reduction='mean', 
	label_smoothing=0.0
)

这个criterion计算input和target之间的交叉熵损失。

It is useful when training a classification problem with C classes. If provided, the optional argument weight should be a 1D Tensor assigning weight to each of the classes. This is particularly useful when you have an unbalanced training set.

举报

相关推荐

0 条评论