Coverage for include/_loss_functions.py: 100%
2 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-12-05 17:26 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-12-05 17:26 +0000
1import torch
3# Pytorch loss functions
4LOSS_FUNCTIONS = {
5 "l1loss": torch.nn.L1Loss,
6 "mseloss": torch.nn.MSELoss,
7 "crossentropyloss": torch.nn.CrossEntropyLoss,
8 "ctcloss": torch.nn.CTCLoss,
9 "nllloss": torch.nn.NLLLoss,
10 "poissonnllloss": torch.nn.PoissonNLLLoss,
11 "gaussiannllloss": torch.nn.GaussianNLLLoss,
12 "kldivloss": torch.nn.KLDivLoss,
13 "bceloss": torch.nn.BCELoss,
14 "bcewithlogitsloss": torch.nn.BCEWithLogitsLoss,
15 "marginrankingloss": torch.nn.MarginRankingLoss,
16 "hingeembeddingloss": torch.nn.HingeEmbeddingLoss,
17 "multilabelmarginloss": torch.nn.MultiLabelMarginLoss,
18 "huberloss": torch.nn.HuberLoss,
19 "smoothl1loss": torch.nn.SmoothL1Loss,
20 "softmarginloss": torch.nn.SoftMarginLoss,
21 "multilabelsoftmarginloss": torch.nn.MultiLabelSoftMarginLoss,
22 "cosineembeddingloss": torch.nn.CosineEmbeddingLoss,
23 "multimarginloss": torch.nn.MultiMarginLoss,
24 "tripletmarginloss": torch.nn.TripletMarginLoss,
25 "tripletmarginwithdistanceloss": torch.nn.TripletMarginWithDistanceLoss,
26}