Losses - Keras
keras.io › api › lossesLoss functions are typically created by instantiating a loss class (e.g. keras.losses.SparseCategoricalCrossentropy). All losses are also provided as function handles (e.g. keras.losses.sparse_categorical_crossentropy). Using classes enables you to pass configuration arguments at instantiation time, e.g.:
Regression losses - Keras
https://keras.io/api/losses/regression_lossesThis makes it usable as a loss function in a setting where you try to maximize the proximity between predictions and targets. If either y_true or y_pred is a zero vector, cosine similarity will be 0 regardless of the proximity between predictions and targets. ... Type of tf.keras.losses.Reduction to apply to loss. Default value is AUTO.
Probabilistic losses - Keras
https://keras.io/api/losses/probabilistic_lossesThe loss function requires the following inputs: y_true (true label): This is either 0 or 1. y_pred (predicted value): This is the model's prediction, i.e, a single floating-point value which either represents a logit, (i.e, value in [-inf, inf] when from_logits=True) or a probability (i.e, value in [0., 1.] when from_logits=False ).