A Generalized Learning Framework for Self-Supervised Contrastive Learning