Losses ====== .. currentmodule:: optax.losses .. autosummary:: convex_kl_divergence cosine_distance cosine_similarity ctc_loss ctc_loss_with_forward_probs hinge_loss huber_loss kl_divergence l2_loss log_cosh ntxent safe_softmax_cross_entropy sigmoid_binary_cross_entropy sigmoid_focal_loss smooth_labels softmax_cross_entropy softmax_cross_entropy_with_integer_labels squared_error Convex Kullback Leibler divergence ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: convex_kl_divergence Cosine distance ~~~~~~~~~~~~~~~ .. autofunction:: cosine_distance Cosine similarity ~~~~~~~~~~~~~~~~~ .. autofunction:: cosine_similarity Connectionist temporal classification loss ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: ctc_loss .. autofunction:: ctc_loss_with_forward_probs Hinge loss ~~~~~~~~~~ .. autofunction:: hinge_loss Huber loss ~~~~~~~~~~ .. autofunction:: huber_loss Kullback-Leibler divergence ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: kl_divergence L2 Squared loss ~~~~~~~~~~~~~~~ .. autofunction:: squared_error .. autofunction:: l2_loss Log hyperbolic cosine loss ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: log_cosh Normalized temperature scaled cross-entropy (NT-Xent) loss ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: ntxent Sigmoid binary cross-entropy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: sigmoid_binary_cross_entropy Sigmoid focal loss ~~~~~~~~~~~~~~~~~~ .. autofunction:: sigmoid_focal_loss Smoothing labels ~~~~~~~~~~~~~~~~ .. autofunction:: smooth_labels Soft-max cross-entropy ~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: safe_softmax_cross_entropy .. autofunction:: softmax_cross_entropy .. autofunction:: softmax_cross_entropy_with_integer_labels