zea.backend.torch.losses

Container for custom loss functions.

Classes

SMSLE([dynamic_range])

Loss function for calculating the Signed-Mean-Squared-Logarithmic-Error.

class zea.backend.torch.losses.SMSLE(dynamic_range=60)[source]

Bases: Module

Loss function for calculating the Signed-Mean-Squared-Logarithmic-Error. This loss function calculates the the mean squared error on log-scaled data, and then takes the sign of the difference between the predicted and ground truth values into account. See https://doi.org/10.1109/TMI.2020.3008537 for more information.

forward(y_true, y_pred)[source]
Parameters:
  • y_true (tensor) – Ground truth values.

  • y_pred (tensor) – The predicted values.

Returns:

SMSLE loss value.

Return type:

loss (tensor)