netmap.model.nbautoencoder.NegativeBinomialLoss

class netmap.model.nbautoencoder.NegativeBinomialLoss(*args: Any, **kwargs: Any)[source]

Bases: Module

__init__(scale_factor=1.0, eps=1e-10)[source]

Negative Binomial loss module.

Parameters:
  • scale_factor (float) – Scale factor applied to predictions. Defaults to 1.0.

  • eps (float) – Small value for numerical stability. Defaults to 1e-10.

forward(y_true, y_pred, theta)[source]

Compute the Negative Binomial negative log-likelihood loss.

Parameters:
Returns:

Mean negative log-likelihood of the NB distribution.

Return type:

torch.Tensor