$f$-MICL: Understanding and Generalizing InfoNCE-based Contrastive Learning