teras.losses.saint_constrastive_loss

teras.losses.saint_constrastive_loss#

teras.losses.saint_constrastive_loss(real, augmented, temperature=0.7, lambda_=0.5)[source]#

Info-NCE inspired contrastive loss for the pretraining objective in the SAINT architecture proposed in the paper, “SAINT: Improved Neural Networks for Tabular Data”.

Parameters:
  • real – Encodings of the real samples

  • augmented – Encodings of the augmented samples

  • temperature (float) – float, Temperature value is used in scaling the logits. Defaults to 0.7

  • lambda – float, determines how the losses are combined. Defaults to 0.5