credit.losses.xsigmoid#
Classes#
X-Sigmoid Loss Function. |
Module Contents#
- class credit.losses.xsigmoid.XSigmoidLoss(reduction='mean')#
Bases:
torch.nn.ModuleX-Sigmoid Loss Function.
This loss function computes a modified loss by using a sigmoid function transformation. It is designed to handle large errors in a non-linear fashion.
- Parameters:
reduction (str) – Specifies the reduction to apply to the output. ‘mean’ | ‘none’. ‘mean’: the output is averaged; ‘none’: no reduction is applied.
- reduction = 'mean'#
- forward(y_t, y_prime_t)#
Forward pass for X-Sigmoid loss.
- Parameters:
y_t (torch.Tensor) – Target tensor.
y_prime_t (torch.Tensor) – Predicted tensor.
- Returns:
X-Sigmoid loss value.
- Return type:
torch.Tensor