一句话总结: Alignment 衡量的是正例之间的距离是否靠近。 Uniformity 衡量的是embeding 在vector space的离散程度(或者说在超球体中的分布情况),越大表示空间坍缩越严重。(Note: 两个值都是越小越好)
Title: 《Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere》
Author:Tongzhou Wang ; Phillip Isola
简要
- 文章指出了Contrastive representation learning的两个重要属性:
- Alignment: two samples forming a positive pair should be mapped to nearby features, and thus be (mostly) invariant to unneeded noise factors.
- Uniformity: feature vectors should be roughly uniformly distributed on the unit hypersphere, pre-serving as much information of the data as possible.
- 作者证明了现有的一些对比学习的算法正是较好地满足了这两条性质才取得了不错的效果。
- 作者提出了一个可优化的 metric 来直接量化这两条属性。通过直接优化该loss,也取得了较好的效果。
- 对应的损失函数的两部分如公式1和公式2所示。
- Pytorch的实现如下图所示。
- 具体的实验见paper。