Fast Differentiable Matrix Square Root and Inverse Square Root

被引:10
作者
Song, Yue [1 ]
Sebe, Nicu [1 ]
Wang, Wei [1 ]
机构
[1] Univ Trento, Dept Informat Engn & Comp Sci, I-38123 Trento, Italy
关键词
Covariance matrices; Matrix decomposition; Decorrelation; Transforms; Computer vision; Deep learning; Task analysis; Differentiable matrix decomposition; decorrelated batch normalization; global covariance pooling; neural style transfer; EQUATION;
D O I
10.1109/TPAMI.2022.3216339
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
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 Pade 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 experiments demonstrate that our methods can also achieve competitive and even slightly better performances. Code is available at https://github.com/KingJamesSong/FastDifferentiableMatSqrt.
引用
收藏
页码:7367 / 7380
页数:14
相关论文
共 58 条
[1]  
Abramov A, 2020, Arxiv, DOI arXiv:2005.12551
[2]   ALGORITHM - SOLUTION OF MATRIX EQUATION AX+XB = C [J].
BARTELS, RH ;
STEWART, GW .
COMMUNICATIONS OF THE ACM, 1972, 15 (09) :820-&
[3]   Solving stable Sylvester equations via rational iterative schemes [J].
Benner, Peter ;
Quintana-Orti, Enrique S. ;
Quintana-Orti, Gregorio .
JOURNAL OF SCIENTIFIC COMPUTING, 2006, 28 (01) :51-83
[4]   Algorithms for the matrix pth root [J].
Bini, D ;
Higham, N ;
Meini, B .
NUMERICAL ALGORITHMS, 2005, 39 (04) :349-378
[5]   Image-to-Image Translation via Group-wise Deep Whitening-and-Coloring Transformation [J].
Cho, Wonwoong ;
Choi, Sungha ;
Park, David Keetae ;
Shin, Inkyu ;
Choo, Jaegul .
2019 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR 2019), 2019, :10631-10639
[6]   Improving Generalization of Batch Whitening by Convolutional Unit Optimization [J].
Cho, Yooshin ;
Cho, Hanbyel ;
Kim, Youngsoo ;
Kim, Junmo .
2021 IEEE/CVF INTERNATIONAL CONFERENCE ON COMPUTER VISION (ICCV 2021), 2021, :5301-5309
[7]   RobustNet: Improving Domain Generalization in Urban-Scene Segmentation via Instance Selective Whitening [J].
Choi, Sungha ;
Jung, Sanghun ;
Yun, Huiwon ;
Kim, Joanne T. ;
Kim, Seungryong ;
Choo, Jaegul .
2021 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION, CVPR 2021, 2021, :11575-11585
[8]   Second-order Attention Network for Single Image Super-Resolution [J].
Dai, Tao ;
Cai, Jianrui ;
Zhang, Yongbing ;
Xia, Shu-Tao ;
Zhang, Lei .
2019 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR 2019), 2019, :11057-11066
[9]   Eigendecomposition-Free Training of Deep Networks for Linear Least-Square Problems [J].
Dang, Zheng ;
Yi, Kwang Moo ;
Hu, Yinlin ;
Wang, Fei ;
Fua, Pascal ;
Salzmann, Mathieu .
IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, 2021, 43 (09) :3167-3182
[10]   Eigendecomposition-Free Training of Deep Networks with Zero Eigenvalue-Based Losses [J].
Dang, Zheng ;
Yi, Kwang Moo ;
Hu, Yinlin ;
Wang, Fei ;
Fua, Pascal ;
Salzmann, Mathieu .
COMPUTER VISION - ECCV 2018, PT V, 2018, 11209 :792-807