Skip to contents

This loss function is weighted by the alpha and beta coefficients that penalize false positives and false negatives.

With alpha=0.5 and beta=0.5, the loss value becomes equivalent to Dice Loss.

This loss function is weighted by the alpha and beta coefficients that penalize false positives and false negatives.

With alpha=0.5 and beta=0.5, the loss value becomes equivalent to Dice Loss.

Usage

loss_tversky(
  y_true,
  y_pred,
  ...,
  alpha = 0.5,
  beta = 0.5,
  reduction = "sum_over_batch_size",
  name = "tversky"
)

Arguments

y_true

tensor of true targets.

y_pred

tensor of predicted targets.

...

For forward/backward compatability.

alpha

coefficient controlling incidence of false positives.

beta

coefficient controlling incidence of false negatives.

reduction

Type of reduction to apply to the loss. In almost all cases this should be "sum_over_batch_size". Supported options are "sum", "sum_over_batch_size" or NULL.

name

String, name for the object

Value

Tversky loss value.