arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2201.12543cs.CVcs.LG
收藏

快速可微矩阵平方根与逆平方根

Fast Differentiable Matrix Square Root and Inverse Square Root

University of Trento(特伦托大学)

Yue Song, Nicu Sebe, Wei Wang

摘要:

以可微方式计算矩阵平方根及其逆在各种计算机视觉任务中是重要的。以往的方法要么采用奇异值分解(SVD)显式分解矩阵或使用牛顿-舒尔茨迭代(NS迭代)来获得近似解。然而,这两种方法在向前传递或向后传递中的计算效率都不够。在本文中,我们提出了两个更有效的变体来计算可微矩阵的平方根和平方根的逆。对于前向传播,一种方法是使用矩阵泰勒多项式(MTP),另一种方法是使用矩阵Padé近似(MPA)。后向梯度的计算是通过迭代求解连续时间李雅普诺夫方程使用矩阵符号函数。一系列的数值试验表明,这两种方法产生相当大的速度比SVD或NS迭代。此外,我们验证了我们的方法在几个现实世界中的应用,包括去相关的批量归一化,二阶视觉Transformer,全局协方差池的大规模和细粒度的识别,专注的协方差池的视频识别,神经风格转移的有效性。实验结果表明,我们的方法也可以实现竞争力,甚至略好的性能。Pytorch实现可在https://github.com/KingJamesSong/FastDifferentiableMatSqrt上获得

英文摘要:

Computing the matrix square root and its inverse in a differentiable manner is important in a variety of computer vision tasks. Previous methods either adopt the Singular Value Decomposition (SVD) to explicitly factorize the matrix or use the Newton-Schulz iteration (NS iteration) to derive the approximate solution. However, both methods are not computationally efficient enough in either the forward pass or the backward pass. In this paper, we propose two more efficient variants to compute the differentiable matrix square root and the inverse square root. For the forward propagation, one method is to use Matrix Taylor Polynomial (MTP), and the other method is to use Matrix Padé Approximants (MPA). The backward gradient is computed by iteratively solving the continuous-time Lyapunov equation using the matrix sign function. A series of numerical tests show that both methods yield considerable speed-up compared with the SVD or the NS iteration. Moreover, we validate the effectiveness of our methods in several real-world applications, including de-correlated batch normalization, second-order vision transformer, global covariance pooling for large-scale and fine-grained recognition, attentive covariance pooling for video recognition, and neural style transfer. The experimental results demonstrate that our methods can also achieve competitive and even slightly better performances. The Pytorch implementation is available at https://github.com/KingJamesSong/FastDifferentiableMatSqrt

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

↑