Warning: This project is deprecated. TensorFlow Addons has stopped development, The project will only be providing minimal maintenance releases until May 2024. See the full announcement here or on github.

Module: tfa.losses

View source on GitHub

Additional losses that conform to Keras API.

Classes

class ContrastiveLoss: Computes the contrastive loss between y_true and y_pred.

class GIoULoss: Implements the GIoU loss function.

class LiftedStructLoss: Computes the lifted structured loss.

class NpairsLoss: Computes the npairs loss between y_true and y_pred.

class NpairsMultilabelLoss: Computes the npairs loss between multilabel data y_true and y_pred.

class PinballLoss: Computes the pinball loss between y_true and y_pred.

class SigmoidFocalCrossEntropy: Implements the focal loss function.

class SparsemaxLoss: Sparsemax loss function.

class TripletHardLoss: Computes the triplet loss with hard negative and hard positive mining.

class TripletSemiHardLoss: Computes the triplet loss with semi-hard negative mining.

class WeightedKappaLoss: Implements the Weighted Kappa loss function.

Functions

contrastive_loss(...): Computes the contrastive loss between y_true and y_pred.

giou_loss(...): Implements the GIoU loss function.

lifted_struct_loss(...): Computes the lifted structured loss.

npairs_loss(...): Computes the npairs loss between y_true and y_pred.

npairs_multilabel_loss(...): Computes the npairs loss between multilabel data y_true and y_pred.

pinball_loss(...): Computes the pinball loss between y_true and y_pred.

sigmoid_focal_crossentropy(...): Implements the focal loss function.

sparsemax_loss(...): Sparsemax loss function [1].

triplet_hard_loss(...): Computes the triplet loss with hard negative and hard positive mining.

triplet_semihard_loss(...): Computes the triplet loss with semi-hard negative mining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023年05月25日 UTC.