loss
用一个不重复的昵称
这个作者很懒,什么都没留下…
展开
-
pytorch MSELoss参数详解
pytorch MSELoss参数详解import torchimport numpy as nploss_fn = torch.nn.MSELoss(reduce=False, size_average=False)a=np.array([[1,2],[3,8]])b=np.array([[5,4],[6,2]])input = torch.autograd.Variable(to...原创 2019-06-21 22:07:16 · 11251 阅读 · 2 评论 -
pytorch CrossEntropyLoss
pytorch CrossEntropyLossimport torchimport torch.nn as nnimport mathloss = nn.CrossEntropyLoss()input = torch.randn(3, 5, requires_grad=True)print('输入:')print(input,input.shape)target = torch...原创 2019-08-05 18:48:20 · 625 阅读 · 0 评论