arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.16468cs.LGstat.ML
收藏

余弦相似度损失的隐藏陷阱

The Hidden Pitfalls of the Cosine Similarity Loss

Aarhus University(奥胡斯大学);University of Amsterdam(阿姆斯特丹大学)

Andrew Draganov, Sharvaree Vadgama, Erik J. Bekkers

AI总结:

该研究揭示余弦相似度损失存在梯度消失的两类隐藏场景,证明优化余弦相似度会增大点模长导致大模长场景不可避免,且该结论普适于多种架构和SSL损失,进而提出截断初始化方法提升SSL收敛速度。

摘要:

我们发现两点间余弦相似度的梯度在两种鲜有研究的场景下会趋于零:(1)某点的模长较大时;(2)两点位于隐空间的相反两端时。与直觉相悖的是,我们证明优化点间的余弦相似度会迫使点的模长增大,因此场景(1)在实践中不可避免。我们进一步发现这些推导极具普适性——适用于多种深度学习架构以及众多标准自监督学习(SSL)损失函数。基于此我们提出cut-initialization(截断初始化):一种对网络初始化的简单改动,可让所有研究的SSL方法收敛更快。

英文摘要:

We show that the gradient of the cosine similarity between two points goes to zero in two under-explored settings: (1) if a point has large magnitude or (2) if the points are on opposite ends of the latent space. Counterintuitively, we prove that optimizing the cosine similarity between points forces them to grow in magnitude. Thus, (1) is unavoidable in practice. We then observe that these derivations are extremely general -- they hold across deep learning architectures and for many of the standard self-supervised learning (SSL) loss functions. This leads us to propose cut-initialization: a simple change to network initialization that helps all studied SSL methods converge faster.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑