Generalized Supervised Contrastive Learning