MSELoss¶
- class
dragon.vm.torch.nn.MSELoss(
size_average=None,
reduce=None,
reduction='mean'
)[source]¶ Compute the element-wise squared error.
The
MSELossfunction is defined as:\[\text{MSELoss}(x, y) = (x - y)^{2} \]Examples:
m = torch.nn.MSELoss() loss = m(torch.ones(2, 3) * 2, torch.zeros(2, 3))
See also
__init__¶
MSELoss.__init__(
size_average=None,
reduce=None,
reduction='mean'
)[source]¶Create a
MSELossmodule.- Parameters:
- size_average (bool, optional) –
Trueto set thereductionto ‘mean’. - reduce (bool, optional) –
Trueto set thereductionto ‘sum’ or ‘mean’. - reduction ({'none', 'mean', 'sum'}, optional) – The reduce method.
- size_average (bool, optional) –