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

Nbody jacobian test #77

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Nbody jacobian test #77

wants to merge 5 commits into from

Conversation

dlanzieri
Copy link
Collaborator

I have added a test function to validate the Automatic differentiation implemented by TensorFlow. This test computes the Jacobians of the 3D power spectrum of the N-body simulation both by Automatic differentiation and finite differences.
The two derivatives are comparable with a tolerance error of 0.1 .
Sadly this test is a bit slow (it spends about 6/7 minutes).
I also have added a notebook with a plot to compare the two Jacobians.
https://github.com/DifferentiableUniverseInitiative/flowpm/blob/Nbody_jacobian/notebooks/num_theo_jacobian.ipynb
psfinit

@dlanzieri dlanzieri requested a review from EiffL April 15, 2021 17:58
@EiffL EiffL changed the title Nbody jacobian Nbody jacobian test Apr 24, 2021
@modichirag
Copy link
Member

Haven't got around to see what YAPF formatting is, but I was looking at the test file and unless I am missing something, I am assuming this line will be a problem as it's an import from a different repo?

https://github.com/DifferentiableUniverseInitiative/flowpm/blob/Nbody_jacobian/tests/test_3D_jacobian.py#L14

I think we should make the pk function a part of flowpm/utils.py since it's kind of on similar footing as cic_paint and cic_readout. What do you guys think.

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.

3 participants