orcanet_contrib.custom_objects
Module Contents
Functions
Functions that returns a dict with all relevant loss functions in this file. |
|
|
Loss function that calculates the mean relative error. |
|
Mean absolute error loss for the uncertainty estimation. |
|
Mean squared error loss for the uncertainty estimation. |
|
Loss function that calculates something similar to a Gaussian Likelihood. |
|
Loss function that calculates something similar to a Gaussian |
|
Loss function that calculates the space angle between the predicted |
Similar loss function as in loss_direction, but here it is just used |
|
|
Copy of the Keras mean absolute error function for testing purposes. |
Attributes
- orcanet_contrib.custom_objects.get_custom_objects()[source]
Functions that returns a dict with all relevant loss functions in this file.
- orcanet_contrib.custom_objects.loss_mean_relative_error_energy(y_true, y_pred)[source]
Loss function that calculates the mean relative error. y_true & y_pred are expected to be e_true & e_pred. L = (e_reco - e_true) / e_true
- Returns
- mreMean relative (energy) error loss
- orcanet_contrib.custom_objects.loss_uncertainty_mae(y_true, y_pred)[source]
Mean absolute error loss for the uncertainty estimation. L = sigma_pred / abs(label_true - label_reco).
- Returns
- lossMean absolute error for uncertainty estimations.
- orcanet_contrib.custom_objects.loss_uncertainty_mse(y_true, y_pred)[source]
Mean squared error loss for the uncertainty estimation. L = sigma_pred / abs(label_true - label_reco)**2.
- Returns
- lossMean squared error for uncertainty estimations.
- orcanet_contrib.custom_objects.loss_uncertainty_gaussian_likelihood(y_true, y_pred)[source]
Loss function that calculates something similar to a Gaussian Likelihood. Requires that y_pred contains only one predicted value (label). y_true & y_pred are expected to contain the predicted/true label and the predicted std for the label. L = ln(std ** 2) + (y_label_pred - y_label_true) / (std ** 2)
- Returns
- lossGaussian Likelihood loss
- orcanet_contrib.custom_objects.loss_uncertainty_gaussian_likelihood_dir(y_true, y_pred)[source]
Loss function that calculates something similar to a Gaussian Likelihood for predicted directions. Requires that y_pred contains three predicted values (labels): dir_x, dir_y, dir_z. y_true & y_pred are expected to contain the predicted/true label and the predicted std for the label. L = ln(std ** 2) + (y_label_pred - y_label_true) / (std ** 2)
- Returns
- lossGaussian Likelihood loss for the directional error
- orcanet_contrib.custom_objects.loss_direction(y_true, y_pred)[source]
Loss function that calculates the space angle between the predicted and the true direction. Not used anymore, can lead to inf gradients due to tf.acos(space_angle_inner_value)! Converts cartesian dirs to spherical coordinate system and then calculates the space angle between the two vectors.
- Returns
- total_lossSpace angle loss
- orcanet_contrib.custom_objects.loss_direction_grad()[source]
Similar loss function as in loss_direction, but here it is just used for manually calculating the gradient in the main function. Done in order to protect the loss_direction function from inf gradients.