Module hal::loss [] [src]

Functions

cross_entropy

Provide a reduced form the cross-entropy loss (single scalar)

cross_entropy_derivative

Provides the vector derivative of the cross-entropy error

cross_entropy_vec

Return a vector form of cross entropy -ylnx - [1-y]ln[1-x]

get_loss

Helper to provide a loss from a string

get_loss_derivative

Helper to provide a loss derivative from a string

get_loss_vec

Helper to provide a loss vector from a string

l2

Provide a reduced form the L2 loss (single scalar)

l2_derivative

Provides the vector derivative of the l2 error

l2_vec

Return a vector form of the l2 error (y - x) * (y - x)

mse

Provide a reduced form the mean squared error loss (single scalar)

mse_derivative

Provides the vector derivative of the mean squared error

mse_vec

Return a vector form of the mean squared error 0.5 * (y - x) * (y - x)