Skip to contents

Tweedie Loss (negative log likelihood)

Usage

loss_tweedie(...)

Arguments

p

Power parameter from the 0, 2 range. It allows to choose a desired distribution from the Tweedie distributions family.

Note

For the moment, you can only use loss_quantile to instantiate a class and not call directly like other loss in keras. Please see: #1342 issue

Examples

y_pred <- array(runif(60), c(2, 10, 1))
y_true <- array(runif(20), c(2, 10, 1))

loss_tweedie(p = 1.5, reduction = 'auto')(y_true, y_pred)
#> tf.Tensor(3.257920131413095, shape=(), dtype=float64)
loss_tweedie(p = 1.5, reduction = 'sum')(y_true, y_pred)
#> tf.Tensor(65.1584026282619, shape=(), dtype=float64)