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

Allow complex numbers in odeint #178

Closed gautierronan closed 1 year ago

gautierronan commented 1 year ago

This PR allows complex numbers in torchdyn.odeint. Only a few simple changes were needed.

Also moves the default save_at instantiation in odeint to avoid a systemic warning when using adaptative step solver.

Zymrael commented 1 year ago

Thanks for the PR! It'd be useful to also include a simple test with odeint applied to complex numbers.

gautierronan commented 1 year ago

I added a test function. Not sure how to integrate with the rest of the code however, I hope it's fine !

Zymrael commented 1 year ago

Looks good! Thanks again