Torch loss functions

Loss functions that are implemented in PyTorch

source

quantile_loss

 quantile_loss (input:torch.Tensor, target:torch.Tensor,
                quantile:torch.Tensor, reduction:str='mean')

source

TorchQuantileLoss

 TorchQuantileLoss (reduction:str='mean')

Implmentation of the quantile loss in Pytorch. Unlike the Numpy-based implementation [`quantile_loss`](https://opimwue.github.io/ddopai/00_utils/torch_loss_functions.html#quantile_loss) in the loss_functions module, this implementation this implementation reduces the results to a scalar value using the specified reduction method. This class is used to train Pytorch models using the quantile loss.

Type Default Details
reduction str mean
Returns None

source

TorchQuantileLoss.forward

 TorchQuantileLoss.forward (input:torch.Tensor, target:torch.Tensor,
                            quantile:ddopai.utils.Parameter|numpy.ndarray)

Forward pass of the quantile loss function.

Type Details
input Tensor
target Tensor
quantile ddopai.utils.Parameter | numpy.ndarray
Returns Tensor

source

pinball_loss

 pinball_loss (input:torch.Tensor, target:torch.Tensor,
               underage:torch.Tensor, overage:torch.Tensor,
               reduction:str='mean')

source

TorchPinballLoss

 TorchPinballLoss (reduction:str='mean')

Implmentation of the pinball loss in Pytorch using specific overage and underage cost. For the pinball loss based on quantiles directly, use the TorchQuantileLoss class. Unlike the Numpy-based implementation [`pinball_loss`](https://opimwue.github.io/ddopai/00_utils/torch_loss_functions.html#pinball_loss) in the loss_functions module, this implementation this implementation reduces the results to a scalar value using the specified reduction method. This class is used to train Pytorch models using the pinball loss.

Type Default Details
reduction str mean
Returns None

source

TorchPinballLoss.forward

 TorchPinballLoss.forward (input:torch.Tensor, target:torch.Tensor,
                           underage:ddopai.utils.Parameter|numpy.ndarray,
                           overage:ddopai.utils.Parameter|numpy.ndarray)

Forward pass of the pinball loss function.

Type Details
input Tensor
target Tensor
underage ddopai.utils.Parameter | numpy.ndarray
overage ddopai.utils.Parameter | numpy.ndarray
Returns Tensor