loss_functions function

loss functions