Open zhDai opened 6 years ago
Please note that no matter W is replaced with US or US
( which means US are aligned in any other different order), the discriminative ability remains exactly unchanged. There are two reasons to re-arrange US.
First, singular vectors by numerical SVD have ambiguous +/- directions. The ambiguity does not matter to SVD itself, but matters to the projection results when $US$ are used as weight vectors.
Two, the decomposition results are sequentially arranged according to the singular values, which is not steady when $W$ is changed. The position relationship of two adjacent feature vectors might be altered when $W$ changes only a little.
If you replace W with US directly, Rank-1 accuracy will be achieved at about 75% on CaffeNet and 80% on ResNet.
ok, thanks~
@zhDai @syfafterzy 请问我用的是resnet18网络,在分类层前面加了一个fc层,在用作者matlab代码转换的时候出现索引超出矩阵维度,请问要怎么修改change_resnet_W.m这代码
Hi I was not quite sure why are you not multiplying US directly, instead of taking the first 'Dim' dimensions U(:,1:Dim)S(1:Dim,:)? Thanks,
@MSiam Because it is convenient for debugging code, thanks for attention.
hello, thanks for your code! But I have a doubt about the matlab code of SVD. I have seen the function of svd, but why are you to replace each weight vector with the "closest" eigen vector? Can I directly use the outcomes of svd (as W=U(:,1:Dim)*S(1:Dim,:))