Module: tfa.losses

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.