torch_ecg.models.loss

Custom loss functions for ECG analysis, as a complement to built-in loss functions in PyTorch.

WeightedBCELoss(pos_weight[, weight, ...])

Weighted Binary Cross Entropy Loss class.

BCEWithLogitsWithClassWeightLoss(class_weight)

Class-weighted Binary Cross Entropy Loss class.

MaskedBCEWithLogitsLoss()

Masked Binary Cross Entropy Loss class.

FocalLoss([gamma, weight, class_weight, ...])

Focal loss class.

AsymmetricLoss([gamma_neg, gamma_pos, ...])

Asymmetric loss class.