losses package¶
Submodules¶
losses.BaseLossConf module¶
losses.FocalLoss module¶
losses.Loss module¶
-
class
losses.Loss.
Loss
(**kwargs)[source]¶ Bases:
torch.nn.modules.module.Module
For support multi_task or multi_output, the loss type changes to list. Using class Loss for parsing and constructing the loss list. :param loss_conf: the loss for multi_task or multi_output.
multi_loss_op: the operation for multi_loss losses: list type. Each element is single loss. eg: “loss”: {
“multi_loss_op”: “weighted_sum”, “losses”: [
- {
“type”: “CrossEntropyLoss”, “conf”: {
“gamma”: 0, “alpha”: 0.5, “size_average”: true}, “inputs”: [“start_output”, “start_label”]
}, {
“type”: “CrossEntropyLoss”, “conf”: {
“gamma”: 0, “alpha”: 0.5, “size_average”: true}, “inputs”: [“end_output”, “end_label”]
}
], “weights”: [0.5, 0.5]
}