deep_metric_learning icon indicating copy to clipboard operation
deep_metric_learning copied to clipboard

In def angular_mc_loss(f, f_p, alpha=45, in_degree=True):

Open zhfwyy opened this issue 7 years ago • 9 comments

term1 = 4 * sq_tan_alpha + matmul(f + f_p, transpose(f_p)) is not term1 = 4 * sq_tan_alpha * matmul(f + f_p, transpose(f_p)) ? The paper's formula: fa;p;n = 4 tan2 α(xa + xp)T xn − 2(1 + tan2 α)xT a xp

zhfwyy avatar Jan 02 '18 03:01 zhfwyy

Thanks for reporting the issue. It seems bug. I'll check it.

ronekko avatar Jan 02 '18 04:01 ronekko

Thank you. With this fix, the accuracy has increased and the response to the hyperparameter alpha has been corrected as described in the paper ("30 < alpha <50" works well in my experiments).

ronekko avatar Jan 08 '18 11:01 ronekko

In "main_angular_loss.py", alpha=UniformDistribution(low=4, high=15), Does that mean 4<alpha<15 ? whether I should set 30<alpha<50 ? Thank you very much.

zhfwyy avatar Feb 13 '18 07:02 zhfwyy

Ah yes, you should set 30<alpha<50. alpha = UniformDistribution(low=4, high=15) should be fixed to alpha = UniformDistribution(low=30, high=50) .

ronekko avatar Feb 13 '18 07:02 ronekko

I use a different dataset, such as person dataset, the optimal alpha value range are not the same. Have you tried different datasets? Thank you very much.

zhfwyy avatar Feb 13 '18 07:02 zhfwyy

No, currently I just tested on only Cars196 (refefred as "Stanford Car" in the Angular loss paper). The paper says in section 4.5:

We found that our method performs consistently well in all three dataset for 36◦ ≤ α ≤ 55◦.

ronekko avatar Feb 13 '18 07:02 ronekko

Thank you very much. I will try again.

zhfwyy avatar Feb 13 '18 07:02 zhfwyy

Can you provide the pseudo code for the angular loss so that I can try writing a code in tensorflow? It might be useful to the larger community. I am not familiar with Chainer so couldn't interpret the exact meaning of term2nd and later part of the implementation. Thanks in advance.

meJayu avatar Feb 26 '18 00:02 meJayu

@ronekko Does this repo reproduce the numbers on Stanford Car in the paper?

ifeherva avatar Feb 11 '19 22:02 ifeherva