Added test for two-stream instability growth rate optimization#135
Open
physicistphil wants to merge 6 commits intoergodicio:mainfrom
Open
Added test for two-stream instability growth rate optimization#135physicistphil wants to merge 6 commits intoergodicio:mainfrom
physicistphil wants to merge 6 commits intoergodicio:mainfrom
Conversation
… backend so that a display isn't required
…ed the diffeqsolve call to the test script itself
adept/_vlasov1d/helpers.py
Outdated
| from diffrax import Solution | ||
| from jax import numpy as jnp | ||
| import matplotlib | ||
| matplotlib.use("Agg") |
Collaborator
There was a problem hiding this comment.
This probably shouldn't be called here in the library module since it'll apply to all scripts that import the module. Can you move it to the test or the script that needs the headless plotting?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR did the following:
e2from the 10th to 200th timestep. Measuring the growth rate by adiff-style metric may be too sensitive to numerical instabilities and fp64 precisionnumpyoperations tojax.numpyto the vlasov1d helpers file for differentiability__call__function in theBaseVlasov1Dmodule so that the inputs to be differentiated (i.e., state and cfg) are explicit (ope -- reverted this so it doesn't break other scripts)When ran, the script creates an mlflow experiment "twostream-optimize" with child runs of "opt-iter-x".
Efforts were made to make the optimization appear functional-like despite the OOP paradigm. To Jax, it shouldn't make a difference whether
self.stateis exploited or not because the function to be differentiated is still a pure function: the__call__takes inparamsand returns the simulation results. Nevertheless the optimization target and mutable parameters should be clear.