标签:average 像素 false pre div lse span batch color
nn.MSELoss()得到的是平均到像素的loss
nn.MSELoss(size_average=False)得到整个batch所有像素loss和
MSELoss(size_average=False).div(batch_size)得到平均图像loss
a=torch.Tensor([[1,1],[1,1]])
b=torch.Tensor([[0,0],[0,0]])
f = nn.MSELoss()
f(a,b)
>>>tensor(1.)
f = nn.MSELoss(size_average=False)
f(a,b)
>>>tensor(4.)
标签:average 像素 false pre div lse span batch color
原文地址:https://www.cnblogs.com/JunzhaoLiang/p/12362482.html