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

jacobian: do not rescale output by sqrt samples #1614

Merged
merged 2 commits into from Oct 17, 2023

Conversation

PhilipVinc
Copy link
Member

@PhilipVinc PhilipVinc commented Oct 16, 2023

Fixes #1613 .

Ensures that jacobian does not return a rescaled output unless an internal flag is specified.
Eventually this flag will be removed, but keeping it for now because it makes our life easier and would complicate @inailuig 's life and PR.

I should add some tests testing jacobian specifically...

@gcarleo
Copy link
Member

gcarleo commented Oct 17, 2023

Looks like it's breaking dynamics

@inailuig
Copy link
Collaborator

I support this change.

We could multiply the intermediate result between jvp and vjp with the pdf / 1/Ns here

res = tree_conj(_vjp(oks, _jvp(oks, v).conjugate()))

similarly to the onthefly implementation.

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (45d334e) 83.74% compared to head (45b4586) 84.83%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1614      +/-   ##
==========================================
+ Coverage   83.74%   84.83%   +1.08%     
==========================================
  Files         262      262              
  Lines       14636    15140     +504     
  Branches     2210     2223      +13     
==========================================
+ Hits        12257    12844     +587     
+ Misses       1832     1761      -71     
+ Partials      547      535      -12     
Files Coverage Δ
netket/jax/_jacobian/logic.py 88.00% <100.00%> (-1.37%) ⬇️
netket/optimizer/qgt/qgt_jacobian_dense.py 97.05% <ø> (+0.12%) ⬆️
netket/optimizer/qgt/qgt_jacobian_pytree.py 98.19% <ø> (+0.08%) ⬆️

... and 83 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PhilipVinc
Copy link
Member Author

@inailuig yes, you're right. I will do that in a followup PR removing this temporary flag... I'll try to keep this in mind.

@PhilipVinc PhilipVinc merged commit 0eddc34 into netket:master Oct 17, 2023
8 of 9 checks passed
@PhilipVinc PhilipVinc deleted the pv/fixes-jacoboia branch October 17, 2023 09:35
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

Successfully merging this pull request may close these issues.

nkjax.jacobian has an undocumented rescaling when center=True
3 participants