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
702 stars 90 forks source link

Added return_best feature #12

Closed marco-digio closed 5 years ago

feiyu-chen96 commented 5 years ago

Hi @marco-digio, thanks for the pull request!

Due to the way the solution was previously returned, I'm not sure this change will keep the best solution. The solution closure creates the solution by using nets objects passed into the solve_system function, so even if we keep a snapshot of the solution function, the nets objects it refers to will still be modified during training afterward. (i.e. we will end up with the same nets no matter the return_best is True or False.)

We might need to create a Solution class such that it can hold copies of the neural nets. I'll think about that later.

codecov-io commented 5 years ago

Codecov Report

Merging #12 into master will increase coverage by 0.75%. The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
+ Coverage   96.56%   97.32%   +0.75%     
==========================================
  Files           5        5              
  Lines         408      411       +3     
==========================================
+ Hits          394      400       +6     
+ Misses         14       11       -3
Impacted Files Coverage Δ
neurodiffeq/ode.py 98.19% <95.83%> (+1.87%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b335d78...79be1ac. Read the comment docs.