-
Notifications
You must be signed in to change notification settings - Fork 23
Dynamics function which uses jnp.ndarray (not pytrees) #730
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
Open
michaeldeistler
wants to merge
16
commits into
main
Choose a base branch
from
matthijs2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
beee15f to
6094102
Compare
6094102 to
1bbf177
Compare
1bbf177 to
6094102
Compare
6094102 to
0817f70
Compare
Closed
Contributor
744a6b7 to
45aee89
Compare
* proposed new api; not tested --------- Co-authored-by: Matthijspals <matthijs-pals@hotmail.com>
43b0fed to
44dc9d1
Compare
d6f1714 to
9fb6f05
Compare
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.

Hi, here is a first attempt at addressing issue #717, having a function
Fthat we can use to step through the model asx_{t+1}=F(x_t), wherex_tis a vector of states, without observables.This is largely a modified version of
build_init_and_step_dynamics_fnbut theinitfunction now also returns two functions: one for going from the full state pytree to a vector of only "true" states, and one for going back from this vector to the full state including observables. It was a bit of a pain to get it working withjit, but it seems to be running now. I haven't tested yet whether or not it works nicely with gradients (edit: seems to be fine now).I am wondering whether we need a separate
initfunction? maybe it is easier if the main function that returns thestepfunction already initialises the model (edit: removed init function).The way inputs are handled here seems a bit clunky, but I don't have a good idea of how to make it better yet. (edit @bantin's solution from Working directly with ODE dynamics function #715 seems nicer; after discussing we will keep as it is for now)
Note, I still have to add tests, and update the log (edit: added!)
The main functionality is there and running: