A contrastive rule for meta-learning