Skip to content

abs_loss

AbsLoss

Bases: torch.nn.Module

The mean absolute value.

Source code in pytorch_adapt\layers\abs_loss.py
 4
 5
 6
 7
 8
 9
10
11
class AbsLoss(torch.nn.Module):
    """
    The mean absolute value.
    """

    def forward(self, x):
        """"""
        return torch.mean(torch.abs(x))