Closed moothes closed 5 years ago
That's correct. This term has no effect on calculating the gradients. I just added it to make sure the AE loss is the same as the equation in the paper.
Thanks for your reply! This paper means the paper that proposed the AE loss or the latest version of your CornerNet paper? In the CornerNet paper that I have, push loss is defined as: I can't find the 1/n.
I was referring to the CornerNet paper.
If we do not subtract 1/n in line 200th, the equation would become L_{push} + 1/(n-1) after the summation. It is because the diagonal elements of dist
are 1s instead of 0s. We subtract dist
by 1/n then the 1s in the diagonal would be cancelled out in the summation.
well, I get it. Thank you for your excellent work and detailed explanation!
@heilaw directly subtract seems work on all element.
does it need using a diag matrix? like dist = dist - (1 / (num + 1e-4))* torch.eye(dist.shape[1])
?
I check your ae_loss function in kp_utils.py and I find that the 200th line you have
dist = dist - 1 / (num + 1e-4)
. This means you subtract 1/n from each distance? why? I think this term have no effect on calculating the gradients of loss.