poisson_loss

function defined in module Flux.Losses


			poisson_loss(ŷ, y; agg = mean)

Return how much the predicted distribution diverges from the expected Poisson distribution y; calculated as -


			sum(ŷ .- y .* log.(ŷ)) / size(y, 2)

More information. .

Example


			julia> y_model = [1, 3, 3];  # data should only take integral values

julia> Flux.poisson_loss(y_model, 1:3)
0.5023128522198171
Methods

There is 1 method for Flux.Losses.poisson_loss: