Mini-Batch Optimization of Contrastive Loss