Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradient formulation for unit normalized Image embedding #41

Open
nitneh opened this issue Apr 7, 2017 · 0 comments
Open

gradient formulation for unit normalized Image embedding #41

nitneh opened this issue Apr 7, 2017 · 0 comments

Comments

@nitneh
Copy link

nitneh commented Apr 7, 2017

bottom[0].diff[i] = self.a*((x_n - x_p)/((bottom[0]).num))
bottom[1].diff[i] = self.a*((x_p - x_a)/((bottom[0]).num))
bottom[2].diff[i] = self.a*((x_a - x_n)/((bottom[0]).num))

If we differentiate, loss function with respect to x_a,x_p,x_n, then, the gradients should be:
(If we are assuming embedding of an image as unit normalized)

bottom[0].diff[i] = self.a*((x_n - x_p)/((bottom[0]).num))
bottom[1].diff[i] = self.a*((- x_a)/((bottom[0]).num))
bottom[2].diff[i] = self.a*((x_a)/((bottom[0]).num))

Please correct me, if I am wrong...

@nitneh nitneh changed the title Issue in gradient formulation gradient formulation for unit normalized Image embedding Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant