huber_loss

pmrf.math.losses.huber_loss(y_true: Array, y_pred: Array, delta: float = 1.0, sample_weight: Array | None = None, multioutput: str | Array | Callable = 'uniform_average') Array

Computes the Huber loss, a robust loss function that transitions from squared error to absolute error depending on the delta threshold.

Parameters:
  • y_true (jnp.ndarray) – Ground truth (correct) target values.

  • y_pred (jnp.ndarray) – Estimated target values.

  • delta (float, default=1.0) – The threshold at which to change between squared error and absolute error.

  • sample_weight (jnp.ndarray, optional) – Optional array of weights for each sample.

  • multioutput (str, jnp.ndarray, or Callable, default='uniform_average') – Defines aggregating of multiple output values. Can be ‘uniform_average’, ‘raw_values’, ‘geometric_mean’, ‘convolution’, or a callable.

Returns:

The calculated aggregated loss.

Return type:

jnp.ndarray