L1Loss¶
- class dragon.vm.torch.nn.L1Loss(
 size_average=None,
 reduce=None,
 reduction='mean'
 )[source]¶
- Compute the element-wise absolute value difference. - The - L1Lossfunction is defined as:\[\text{L1Loss}(x, y) = |x - y| \]- Examples: - m = torch.nn.L1Loss() loss = m(torch.ones(2, 3), torch.zeros(2, 3)) - See also 
__init__¶
- L1Loss.- __init__(
 size_average=None,
 reduce=None,
 reduction='mean'
 )[source]¶
- Create a - L1Lossmodule.- 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) – 
 
