caffe-video_triplet icon indicating copy to clipboard operation
caffe-video_triplet copied to clipboard

rank_hard_loss_layer.cpp

Open Robert0812 opened this issue 9 years ago • 6 comments

How much amount of contribution does tloss2 have in the forward process? I notice that you only have the term D(x, x-) rather than D(x+, x-) in your ICCV paper.

Robert0812 avatar Sep 30 '15 02:09 Robert0812

I have the same problem

kli-casia avatar Dec 05 '15 13:12 kli-casia

Just see it as an easy way to increase training samples.

xiaolonw avatar Dec 06 '15 04:12 xiaolonw

@xiaolonw that's make sense, thank you xiaolong

kli-casia avatar Dec 06 '15 05:12 kli-casia

@xiaolonw
rank_hard_loss.cpp第228行。 如果loss = max(0,||x - x1||^2 - ||x-x2||^2 + margin)的话, 我的理解是梯度应该这样计算: dloss/dx = 2(x2-x1) dloss/dx1 = -2(x-x1) dloss/dx2 = 2(x-x2) 但是代码中跟我理解的不一样,请问是我理解错么,还请解释一下。

icodingc avatar Jun 07 '16 05:06 icodingc

@icodingc

that is because we are using cosine distance, which means after normalization layer, ||x|| = 1, ||x1|| = 1. Thus loss = max(0, (2-2x_x1) - (2-2x_x2) + margin )

xiaolonw avatar Jun 07 '16 15:06 xiaolonw

thank you xiaolong.

icodingc avatar Jun 07 '16 15:06 icodingc