-
Notifications
You must be signed in to change notification settings - Fork 190
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
specifiying pdf in nk.jax.jacobian has no effect by default #1979
Comments
This depends on your state, I think, so it should not be surprising?
Yes, indeed. We do not multiply by By the way, the idea at the time was that not specifying I'm unsure what the best solution is. Instead, if we strive for consistency this would mean breaking a lot of code around (again, people please comment). (As an historical note, |
Regarding the mean of the gradient, I would point out that in the example above you are only averaging the Jacobian and therefore what you see is not the gradient, unless you have a flat local energy equal to one. I do agree with the principle of considering The way I see it is that |
Expose how exactly? like it is now, or differently? |
I do not see a problem with how it is now, but if it is unclear maybe something could be added to the doc? |
I had put an underscore because It felt a bit like an hack (but was internally useful). The main point was that I was not sure if we want to implement a multiply by pdf or multiply by sqrt of pdf. |
I have personally used both versions before. Maybe having two flags implementing both variants and returning an error if both are true could be a solution that would then make everyone happy. |
Yes correct, I'm referring to the mean gradients of the network wrt to its parameters, ie. |
So summing up. No problem. To do what Luca proposes we could add a kwarg |
Hi,
While playing around with nk.jax.jacobian to compute the mean gradients from a fullsum state, along the lines of:
I noticed that the means were unreasonably large and it made no difference whether I specified pdf or not.
If I understand the implementation of nk.jax.jacobian correctly, the pdf argument is essentially ignored if both centered==False and _sqrt_rescale==False.
Happy to do a PR (if this is indeed a bug), but it might make sense to think about this internal flag before.
I'm using NetKet version 3.14.3.
Best,
Marc
The text was updated successfully, but these errors were encountered: