crested.tl.losses.PoissonMultinomialLoss#
- class crested.tl.losses.PoissonMultinomialLoss(total_weight=1.0, eps=1e-07, log_input=True, multinomial_axis='task', reduction='sum_over_batch_size', name='PoissonMultinomialLoss')#
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.eps (
float
(default:1e-07
)) – Small value to avoid log(0).log_input (
bool
(default:True
)) – If True, applies exponential transformation to predictions to produce counts.multinomial_axis (
str
(default:'task'
)) – Either “length” or “task”, representing the axis along which multinomial proportions are calculated.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#
|
Compute the PoissonMultinomialLoss. |
|
|
Return the configuration of the loss function. |
Attributes#
- PoissonMultinomialLoss.dtype#
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.
- classmethod PoissonMultinomialLoss.from_config(config)#
- PoissonMultinomialLoss.get_config()#
Return the configuration of the loss function.