crested.tl.losses.PoissonMultinomialLoss#

class crested.tl.losses.PoissonMultinomialLoss(total_weight=1.0, log_transform=True, axis=-1, eps=1e-07, norm='sum', reduction='sum_over_batch_size', name='PoissonMultinomialLoss', multinomial_axis='deprecated', log_input='deprecated')#

Poisson decomposition with multinomial specificity term for aggregated counts.

Combines Poisson loss for total counts with a multinomial term for class proportions.

Parameters:
  • total_weight (float (default: 1.0)) – Weight of the Poisson term in the total loss. Increase to prioritize magnitude, decrease to prioritize shape. Approximate value depends on your data’s range and number of classes, but anecdotally, small ranges (~1e-4) have worked best.

  • eps (float (default: 1e-07)) – Small value to avoid log(0).

  • log_transform (bool (default: True)) – Apply logarithmic transformation to truth and predictions.

  • axis (int (default: -1)) – Axis to reduce over. If predicting 1D values, should be -1 (Decima-style). If predicting 2D values like tracks, can be -2 (to compare within tracks, like Borzoi) or -1 (to compare within classes, like Decima for every bin)

  • norm (Literal['sum', 'max'] (default: 'sum')) – How to normalize the data to [0,1] ranges for the multinomial loss. ‘sum’ (default) divides by the sum of that gene, ‘max’ divides by the max.

  • reduction (str (default: 'sum_over_batch_size')) – Type of reduction to apply to the loss: “mean” or “none”.

  • name (str (default: 'PoissonMultinomialLoss')) – Name of the loss function.

Attributes table#

Methods table#

call(y_true, y_pred)

Compute the PoissonMultinomialLoss.

get_config()

Return the configuration of the loss function.

Attributes#

Methods#

PoissonMultinomialLoss.call(y_true, y_pred)#

Compute the PoissonMultinomialLoss.

Parameters:
  • y_true – True target values (aggregated counts).

  • y_pred – Predicted values.

Returns:

Combined loss value.

PoissonMultinomialLoss.get_config()#

Return the configuration of the loss function.