NeuroDiffGym / neurodiffeq

A library for solving differential equations using neural networks based on PyTorch, used by multiple research groups around the world, including at Harvard IACS.
http://pypi.org/project/neurodiffeq/
MIT License
680 stars 89 forks source link

Failed to train a neural network to fit the euqation of motion for celectial objects #143

Closed gaowutong closed 2 years ago

gaowutong commented 2 years ago

I tried to integrate the equation of motion for celestial objects but failed. Please click the link here for my demo: https://nbviewer.jupyter.org/github/gaowutong/neurodiffeq_demo/blob/main/neurodiffeq_demo.ipynb In the demo, I used the default network.

shuheng-liu commented 2 years ago

Can you nondimensionalize the system before feeding to neurodiffeq? It's known to be a problem when input scales are too big/small probably because of PyTorch's default way of initializing network weights. See this FAQ.

Also, I noticed you are using a deprecated solve_system function. We recommend switching to the new Solver1D class. See cell [16] of this tutorial.

gaowutong commented 2 years ago

Thanks for your suggestions! I successfully trained the network but the result was not good.

I am still adjusting some network parameters, hoping to get a result as good as the numerical integration result.

Please see my updated demo here.