EasyDeepLearn

InfoNCE loss — formula and intuition.

hard

Answer

  • L = -log [exp(s(x,  x+)/τ)  /  Σj  exp(s(x,  xj)/τ)][\operatorname{exp}(s(x, \;x^{+}) / {\tau})\; / \;{\Sigma}_{j}\;\operatorname{exp}(s(x, \;x_{j}) / {\tau})] — softmax over one positive and many negatives, temperature τ.
  • Cross-entropy that treats classification 'which of N is the positive?'.
  • Lower bound on mutual information between x and x+x^{+}.
  • Standard loss for contrastive SSL (SimCLR, CLIP, MoCo, etc.).
  • Temperature τ controls concentration: low τ → sharp, hard-negative-focused.
Check yourself — multiple choice
  • Random
  • -log [exp(s(x,x+)/τ)  /  Σj  exp(s(x,xj)/τ)][\operatorname{exp}(s(x, x^{+}) / {\tau})\; / \;{\Sigma}_{j}\;\operatorname{exp}(s(x, x_{j}) / {\tau})] — softmax cross-entropy 'which is the positive'; lower bound on MI(x,  x+)\mathrm{MI}(x, \;x^{+}); τ controls concentration
  • Same as MSE
  • Not real

InfoNCE: softmax over positive vs negatives; MI lower bound; τ sharpness.

#representation-learning#theory

Practise Unsupervised Learning

214 interview questions in this topic.

Related questions