greydanus / hamiltonian-nn

Code for our paper "Hamiltonian Neural Networks"

Home Page:https://greydanus.github.io/2019/05/15/hamiltonian-nns/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rk4 method

steph1793 opened this issue · comments

Hi,
I read your paper and find the work you have done absolutly amazing. I am reading the github right now to fully understand how the "framework" works. But I have a little issue with the method rk4. Is it used for the estimation of the derivative of the hamiltonian? If it is the case what is the purpose behind computing the drivative that way.

Thanks in advance

commented

Hi Stefane,
Thanks, I'm glad you found it interesting. The RK4 is a type of integrator (slightly more sophisticated than Euler integration, but same general idea). It can be used to integrate arbitrary vector fields. Here, we're using it to integrate the vector field learned by the Hamiltonian neural network. We don't use the method during training -- only for evaluation/sampling. The purpose behind using this approach during evaluation/sampling is that it is more accurate and efficient than other integration techniques. Furthermore, the scipy version lets us set the error tolerance, so as to have a (loose) upper bound on the error. I think there's some related discussion about integrators for these sorts of models in the appendix of the HGN paper (https://arxiv.org/abs/1909.13789).
Hope that helps,
Sam

Thank you very much!
It was very clear, I will look at the paper.