deephyper.ensemble.loss.NormalNegLogLikelihood

deephyper.ensemble.loss.NormalNegLogLikelihood#

class deephyper.ensemble.loss.NormalNegLogLikelihood[source]#

Bases: Loss

The negative log-likelihood of a normal distribution.

Given observed data y_true and the predicted parameters of the normal distribution y_pred["loc"], y_pred["scale"].

Methods

__call__(y_true: ndarray, y_pred: ndarray | Dict[str, ndarray]) ndarray[source]#

Compute the negative log-likelihood of a normal distribution.

Parameters:
  • y_true (np.ndarray) – the true target values.

  • y_pred (np.ndarray or Dict[str, np.ndarray]) – the predicted target values. If it is a _Dict[str, np.ndarray]_ then it should contain a key "loc".

Returns:

the loss value with first dimension n_samples.

Return type:

np.ndarray