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

different sign on the gradients dS, dz and line6 in algorithm 3 #18

Open
Sichao-Yang opened this issue May 20, 2024 · 1 comment
Open

Comments

@Sichao-Yang
Copy link

Hi Dr. Po-Wei Wang

many thanks for opensourcing this greate work. When I read through your code. I have noticed there are a few differnce between the code and the paper:

  1. at src/satnet_cpu.cpp in function mix_kernel, for the backward pass, you use g = -(I-v_i v_i') (g+v_0 dz[i]), but I checked that based on the paper's algorithm 3 this should be dg=-P*(g - v_o dz[i]) with a minus sign? please correct me if im wrong.
  2. in the paper, for dl/dS and dl/zi, in both equation 11 and 12, there are minus signs. but in the code it becomes: dS = U W + V Phi and dzi = v0'Phi si. please can you tell me why the signs are reversed?

many thanks for you help!
sichao y

@xflash96
Copy link
Member

Thanks for the check. It's been a few years but I remember this is because we changed the sign of dZ to save some computation... I.e., think the dz, U, and Phi in the code before returning gradient to be negated the symbol in the paper. The resulting gradient is still correct; we checked with gradcheck and you can also infer it from the symbol above.

But I agree that such change may not worth the clarity.

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

2 participants