index for optimal match
ChaoWANG0511 opened this issue · 3 comments
你好 :)
祝贺您们的论文ShotVAE被AAAI接收!
关于lib/utils/mixup.py的mixup_vae_data函数,请问第17行 index = torch.argmin(kl_metric, dim=1) 是否总会返回 对角线 下标?因为和一个样本D_KL最小的样本永远是它自己 ,此时 D_KL = 0 。
谢谢。
Yes you are right, torch.argmin will return the smallest number w.r.t. the i-th sample. But here our distance is actually -kl(p|q) <=0, which can be less than zero. In this situation, torch.argmin will return the j-th index that have the most discriminative distance with i, i.e. distance = -100, which is actually our target to match the most dislike pairs. I will add some annotations here. Thanks for your careful reviews.
Thank you very much for your answer. I still have 2 more questions, maybe I misunderstood. 1) in the script lib/utils/mixup.py, the function gaussian_kl_divergence_calculation used in generating kl_metric is calculating kl(p|q) (which corresponds to eq(39) of https://arxiv.org/pdf/1907.08956v1.pdf), so it is >=0 , not -kl(p|q) <=0. 2) you said your target is to find the most dislike pair that has the most discriminative distance, but in ShotVAE paper you said the optimal interpolation is about finding the pair that has the most similar z. Thank you :)
Oh I have reviewed the paper and the code and I find you are right. To perform minimum similarity matching, we should use
_,index = torch.topk(kl_metric,2,largest=False)
index = index[:,1]
and to perform maximum similarity matching, we should use
index = torch.argmin(-1*kl_metric,dim=1)
Because of the conflict between this problem with the paper's implementation, we ran the experiments again on Cifar-10 (with 4k labels) with 3 settings: random matching, minimum similarity matching and maximum similarity matching. Unfortunately, I do not find significance evidence that the last two is better than random matching (well in some random seeds I find maximum similarity matching is slightly better than the other two). Thankfully, there are no discernible differences between the new findings and those published in the paper. I will revise this point in our arxiv paper.
Once again, I sincerely appreciate your comprehensive review. Thanks for pointing it out!