Torch loss functions
quantile_loss
quantile_loss (input:torch.Tensor, target:torch.Tensor, quantile:torch.Tensor, reduction:str='mean')
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 |
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 |
pinball_loss
pinball_loss (input:torch.Tensor, target:torch.Tensor, underage:torch.Tensor, overage:torch.Tensor, reduction:str='mean')
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 |
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 |