pytorch api torch.nn.MSELoss

CLASS torch.nn.MSELoss(size_average=None, reduce=None, reduction='mean')
计算输入X和输出Y的均方误差.

参数 描述
reduction (string,optional),默认为平均值
loss = nn.MSELoss()
input = torch.randn(3, 5, requires_grad=True)
target = torch.randn(3, 5)
output = loss(input, target)

参考文献:
https://pytorch.org/docs/stable/nn.html#torch.nn.MSELoss

你可能感兴趣的:(人工神经网络)