Mini-Batch Optimization of Contrastive Loss

07/12/2023
by   Jaewoong Cho, et al.
0

Contrastive learning has gained significant attention as a method for self-supervised learning. The contrastive loss function ensures that embeddings of positive sample pairs (e.g., different samples from the same class or different views of the same object) are similar, while embeddings of negative pairs are dissimilar. Practical constraints such as large memory requirements make it challenging to consider all possible positive and negative pairs, leading to the use of mini-batch optimization. In this paper, we investigate the theoretical aspects of mini-batch optimization in contrastive learning. We show that mini-batch optimization is equivalent to full-batch optimization if and only if all NB mini-batches are selected, while sub-optimality may arise when examining only a subset. We then demonstrate that utilizing high-loss mini-batches can speed up SGD convergence and propose a spectral clustering-based approach for identifying these high-loss mini-batches. Our experimental results validate our theoretical findings and demonstrate that our proposed algorithm outperforms vanilla SGD in practically relevant settings, providing a better understanding of mini-batch optimization in contrastive learning.

READ FULL TEXT

page 9

page 38

research
03/09/2021

Doubly Contrastive Deep Clustering

Deep clustering successfully provides more effective features than conve...
research
06/06/2023

BatchSampler: Sampling Mini-Batches for Contrastive Learning in Vision, Language, and Graphs

In-Batch contrastive learning is a state-of-the-art self-supervised meth...
research
05/19/2023

Not All Semantics are Created Equal: Contrastive Self-supervised Learning with Automatic Temperature Individualization

In this paper, we aim to optimize a contrastive loss with individualized...
research
12/09/2021

HBReID: Harder Batch for Re-identification

Triplet loss is a widely adopted loss function in ReID task which pulls ...
research
02/08/2021

Improving memory banks for unsupervised learning with large mini-batch, consistency and hard negative mining

An important component of unsupervised learning by instance-based discri...
research
02/24/2022

Provable Stochastic Optimization for Global Contrastive Learning: Small Batch Does Not Harm Performance

In this paper, we study contrastive learning from an optimization perspe...
research
05/29/2018

MBA: Mini-Batch AUC Optimization

Area under the receiver operating characteristics curve (AUC) is an impo...

Please sign up or login with your details

Forgot password? Click here to reset