--- title: Losses keywords: fastai sidebar: home_sidebar summary: "This contains losses not available in fastai or Pytorch." description: "This contains losses not available in fastai or Pytorch." nb_path: "nbs/050_losses.ipynb" ---
inp = torch.rand(8, 3, 10)
targ = torch.randn(8, 3, 10)
test_close(HuberLoss(delta=1)(inp, targ), nn.SmoothL1Loss()(inp, targ))
LogCoshLoss()(inp, targ)
inp = torch.rand(8, 3, 10)
targ = torch.randn(8, 3, 10)
targ[targ >.8] = np.nan
nn.L1Loss()(inp, targ), MaskedLossWrapper(nn.L1Loss())(inp, targ)