DiffEqML / torchdyn

A PyTorch library entirely dedicated to neural differential equations, implicit models and related numerical methods
https://torchdyn.org
Apache License 2.0
1.4k stars 130 forks source link

Trajectory #78

Closed pharringtonp19 closed 3 years ago

pharringtonp19 commented 3 years ago

The model that I am training is very similar to ANODE as defined in torchdyn/tutorials/04_augmentation_strategies.ipynb

Given a time step in [0,1], I would like to get the "flow" of the model at that time step - more specifically the flow for a batch of data (I hope my language is correct!). Chen (2018) writes that "Most ODE solvers have the option to output the state z(t) at multiple times." Is there a way to do this torchdyn when using neuralDE and Augmenter? I was hoping to pass these flows into another function -- thanks

Zymrael commented 3 years ago

Hi @pharringtonp19. That can be achieved through the trajectory method of NeuralODE, see here. Note that if you would still want to use the adjoint method, you'd have to modify the torchdiffeq call with odeint_adjoint

pharringtonp19 commented 3 years ago

@Zymrael Thanks for the explanation

Zymrael commented 3 years ago

Cool! Closing for now.