Contrastive learning-inspired training