![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
loss
用一个不重复的昵称
这个作者很懒,什么都没留下…
展开
-
pytorch MSELoss参数详解
pytorch MSELoss参数详解 import torch import numpy as np loss_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 · 11197 阅读 · 2 评论 -
pytorch CrossEntropyLoss
pytorch CrossEntropyLoss import torch import torch.nn as nn import math loss = nn.CrossEntropyLoss() input = torch.randn(3, 5, requires_grad=True) print('输入:') print(input,input.shape) target = torch...原创 2019-08-05 18:48:20 · 606 阅读 · 0 评论