我是靠谱客的博主 安静书包,这篇文章主要介绍torch nn模块API介绍,现在分享给大家,希望可以做个参考。

Conv1d

类原型:

torch.nn.Conv1d(
	in_channels, 
	out_channels, 
	kernel_size, 
	stride=1, 
	padding=0, 
	dilation=1, 
	groups=1, 
	bias=True, 
	padding_mode='zeros', 
	device=None, 
	dtype=None
)

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.

待补充:

https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html?highlight=crossen#torch.nn.CrossEntropyLoss

最后

以上就是安静书包最近收集整理的关于torch nn模块API介绍的全部内容,更多相关torch内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(53)

评论列表共有 0 条评论

立即
投稿
返回
顶部