@CVPR2018: Efficient unrolling iterative matrix square-root normalized ConvNets, implemented by PyTorch (and code of B-CNN,Compact bilinear pooling etc.) for training from scratch & finetuning.
@WarBean Great! Thanks for your amazing work. These are problems i have never found before, due to the commonly used settings are iterN=5, input=symm. Thank you again!
经过对MPNCOV.py里面的各个Function的测试,发现Sqrtm的前向后向似乎有两个问题:
1.当Sqrtm输入的batchSize x dim x dim矩阵不是对称阵的时候,后向梯度不对; 2.当Sqrtm的iterN为1的时候,前向结果和后向梯度不对。
只不过论文中刚好都是输入对称阵、iterN > 1的情况,所以没触发上述错误。
测试方法:跟PyTorch autograd出来的结果进行对比
测试脚本如下,其中注释为“修改(1)”、“修改(2)”的地方分别修复上述两个问题:
修复前的iterN = 1测试结果,对称和非对称都出错:
修复前的iterN = 5测试结果,对称没错,非对称出错:
修复后的iterN = 1测试结果,都没出错:
修复后的iterN = 5测试结果,都没出错: