On the duality between contrastive and non-contrastive self-supervised learning