caffe-video_triplet
caffe-video_triplet copied to clipboard
rank_hard_loss_layer.cpp
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.
I have the same problem
Just see it as an easy way to increase training samples.
@xiaolonw that's make sense, thank you xiaolong
@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
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 )
thank you xiaolong.