Identifying Physical Law of Hamiltonian Systems via Meta-Learning

1 INTRODUCTION . Hamiltonian mechanics , a reformulation of Newtonian mechanics , can be used to describe classical systems by focusing on modeling continuous-time evolution of system dynamics with a conservative quantity called Hamiltonian ( Goldstein et al. , 2002 ) . Interestingly , the formalism of the Hamiltonian provides both geometrically meaningful interpretation ( Arnol ’ d et al. , 2001 ) and efficient numerical schemes ( Feng & Qin , 2010 ) representing the state of complex systems in phase space with symplectic structure . Although formalism was originally developed for classical mechanics , it has been applied to various fields of physics , such as fluid mechanics ( Salmon , 1988 ) , statistical mechanics ( Reichl , 1999 ) , and quantum mechanics ( Sakurai & Commins , 1995 ) . While it has many useful mathematical properties , establishing an appropriate Hamiltonian of the unknown phenomena is a challenging problem . A Hamiltonian for a system can be modeled by a shared expression of the Hamiltonian and physical parameters . For instance , the Hamiltonian of an ideal pendulum is described as H = p 2 2ml2 + mgl ( 1 − cos q ) ( shared expression ) , with mass m , pendulum length l , and gravity constant g ( physical parameters ) , whereas q and p are the angle of the pendulum and the corresponding conjugate momentum ( state of the system ) , respectively . Once an appropriate functional of the Hamiltonian is established from observing several pendulums , a new pendulum-like system can be readily recognized by adapting new physical parameters on the expression . Therefore , identifying an appropriate expression of the Hamiltonian is an important yet extremely difficult problem in most science and engineering areas where there still remain numerous unknown processes where it is even uncertain whether a closed-form solution or mathematically clear expression exists . In the recent era of deep learning , we can consider the use of learning-based algorithms to identify an appropriate expression of the Hamiltonian with sufficient data . To determine the Hamiltonian underlying the unknown physical process , the Hamiltonian should satisfy two fundamental conditions : ( 1 ) it should fit well on previously observed data or motions , ( 2 ) it should generalize well on newly observed data from new systems if the systems share the same physical law with previous ones . The first condition has been mitigated by explicitly incorporating symplectic structure or conservation laws on neural networks , called Hamiltonian neural networks ( HNN ) ( Greydanus et al. , 2019 ) for learning Hamiltonian dynamics . HNN and its variants have been shown to be effective in learning many useful properties of the Hamiltonian ( Toth et al. , 2020 ; Chen et al. , 2020 ; Zhong et al. , 2020a ; Sanchez-Gonzalez et al. , 2019 ; Jin et al. , 2020 ) . In their experiments , it has been shown that HNN and its variants work well on learning conservation laws or continuous-time translational symmetry , enable the learning of complex systems stably by incorporating numerical integrators and generalize on multiple initial conditions or controls for the given system . However , there is limited work regarding a trained model that works well on totally new systems governed by the same physical law with novel physical parameters . To consider the second condition , we propose that meta-learning , which aims to train a model well generalized on novel data from observing a few examples , can be a potential key to learning a functional of Hamiltonian as a data-driven method . There have been several representative categories of meta-learning algorithms , such as the metric-based method ( Snell et al. , 2017 ; Sung et al. , 2018 ) , black-box method ( Santoro et al. , 2016 ; Bertinetto et al. , 2019 ) , and gradient-based method ( Rusu et al. , 2019 ; Flennerhag et al. , 2020 ) . Among these methods , we especially focus on the gradientbased method , which is readily compatible with any differentiable model and flexibly applicable to a wide variety of learning problems ( Finn et al. , 2017 ; Xu et al. , 2018 ; Hospedales et al. , 2020 ) . One of the most successful algorithms of the gradient-based method is Model-Agnostic MetaLearning ( MAML ) ( Finn et al. , 2017 ) , which consists of a task-specific adaptation process and a meta-optimization process . The key observations supporting its potential are the resemblance between these processes and the identification of the physical laws of the Hamiltonian . The schematic is shown in Figure 1 . The task-adaptation process , which adapts the initial model parameters to a task-specific train set , resembles the process of adapting hypothesized governing equations to observations of several physical systems . The meta-optimization process , which updates the initial model parameters by validating each task-specific adapted parameters to a task-specific test set , is similar to correcting the hypothesized governing equations by validating each system-specific Hamiltonian on new data from the corresponding physical systems . In addition , ( Raghu et al. , 2020 ) proposed that the recent success behind these meta-learning algorithms was due to providing qualitative shared representation across tasks rather than learning initial model parameters that encourage rapid adaptation ( Finn et al. , 2017 ) . This hypothesis may support our suggestion that a meta-learner can be efficient in identifying the shared representation of a Hamiltonian . From this point of view , we experiment on several types of physical systems to verify whether these meta-learning algorithms are beneficial to our desired learning problems . Our contributions are summarized as follows : • We formulate the problem of identifying the shared representation of unknown Hamiltonian as a meta-learning problem . • For learning to identify the Hamiltonian representations , we incorporate the HNN architecture on meta-learning algorithms . • After meta-training the meta-learner , we adapt the model on new systems by learning the data of partial observations and predict the dynamics of the systems as a vector field in phase space . • We evaluate our method on several types of physical systems to explore the efficiency of our methods with various experimental settings . 2 PRELIMINARIES . 2.1 HAMILTONIAN NEURAL NETWORKS . In Hamiltonian mechanics , the state of a system can be described by the vector of canonical coordinates , x = ( q , p ) , which consist of position , q = ( q1 , q2 , ... , qn ) and its conjugate momentum , p = ( p1 , p2 , ... , pn ) in phase space , where n is the degree of freedom of the system . Then , the time evolution of the system is governed by Hamilton ’ s equations ẋ = ( ∂H ∂p , − ∂H ∂q ) = Ω∇xH ( x ) , where H ( x ) : R2n → R is the Hamiltonian that is conservative during the process and Ω = [ 0 In −In 0 ] is a 2n× 2n skew-symmetric matrix . From the Hamiltonian equations , the Hamiltonian vector field in phase space , which is interpreted as the time evolution of the system ẋ , is the symplectic gradient of the Hamiltonian Ω∇xH ( x ) , which is determined by the Hamiltonian function and the state of the system itself . Then , the trajectory of the state can be computed by integrating the symplectic gradient of the Hamiltonian . If the Hamiltonian does not depend on the time variable , the Hamiltonian remains constant during the time evolution , because moving along the direction of the symplectic gradient keeps the Hamiltonian constant ( Arnol ’ d , 2013 ) . In ( Greydanus et al. , 2019 ) , the Hamiltonian function can be approximated by neural networks , Hθ , called HNN . To make the Hamiltonian function constant in motion , the loss of HNN is defined by the distance between the true vector field and the symplectic gradient of Hθ , LHNN = ‖ẋ− Ω∇xHθ ( x ) ‖22 . ( 1 ) 2.2 MODEL-AGNOSTIC META-LEARNING AND FEATURE REUSE HYPOTHESES . A key assumption behind MAML is that separately trained models for each task share meta-initial parameters θ that could be improved rapidly for any task ( Finn et al. , 2017 ) . Suppose that each given task , Ti , composed of Di = { Dtri , Dtei } , is drawn from a task distribution , Ti ∼ p ( T ) . The learning algorithms usually consist of bi-level optimization processes ; ( inner-loop ) the task-specific adaptation to each train set , θ′i = θ − α∇θLTi ( Dtri ; θ ) , ( 2 ) and ( outer-loop ) the meta-optimization on each test set , θ ← θ − β∇θ ∑ Ti∼p ( T ) LTi ( Dtei ; θ′i ) , ( 3 ) where θ could be any differentiable model ’ s parameters that are expected to learn the shared representations of various tasks , and α and β are the step sizes of the inner and outer loops , respectively . Meanwhile , ( Raghu et al. , 2020 ) observed that during the inner-loop process , the task-specific distinction of the model parameters θ is mostly from the last layer of the networks , whereas the entire body of the model hardly changed . Therefore , they hypothesized that the body of the model behaves as a shared representation across the different tasks , whereas the head of the model behaves as a task-specific parameter , which is called the feature reuse hypothesis . From this hypothesis , they proposed a gradient-based meta-learning algorithm called Almost No Inner Loop ( ANIL ) by slightly modifying MAML by freezing all but updating the last layer of the networks during the inner-loop process . They showed that ANIL performs on par or better than MAML on several benchmarks , and has a computational benefit compared to its counterpart . For the algorithm , when the meta-learner consists of l layers θ = ( θ ( 1 ) , ... , θ ( l−1 ) , θ ( l ) ) , the inner-loop update is modified as θ′i = ( θ ( 1 ) , ... , θ ( l−1 ) , θ ( l ) − α∇θ ( l ) LTi ( Dtri ; θ ) ) . ( 4 ) As many physical processes could be expressed as an invariant shared expression of Hamiltonian and variable physical parameters , such meta-learning scheme , which encourages to separate the invariant part and varying part , can be expected to be more efficient to learn new systems by the relatively small number of parameter update . 3 METHOD . 3.1 IDENTIFYING SHARED REPRESENTATION OF HAMILTONIAN VIA META-LEARNER . The main goal of our study is to train a model to identify the shared representation of the Hamiltonian using observations of dynamics from several systems that are assumed to be governed by the same physical law with different physical parameters . From a meta-learning point of view , each system is regarded as a task Ti , where the physical parameters of the system are drawn from the distribution of p ( T ) . The observations of the system Ti can be split into Di = { Dtri , Dtei } , where Dtri and Dtei denote the task-specific train and test sets , respectively . The observations of both Dtri and Dtei are given by a set of tuples of canonical coordinates x = ( q , p ) and their time-derivatives ẋ = ( q̇ , ṗ ) as the ground truth . For each system , the task-specific model parameters are obtained from Equation 2 or Equation 4 by computing the task-specific loss using Equation 1 on each train set Dtri , LTi ( Dtri ; θ ) = ∑ ( x , ẋ ) ∼Dtri ‖ẋ− Ω∇xHθ ( x ) ‖22 , ( 5 ) and the meta-optimization can be operated on the batch of systems as Equation 3 by minimizing the loss over the batch of physical parameters sampled from p ( T ) . Each loss is computed by evaluating each task-specific adapted model parameters θ′i to each test set Dtri , ∑ Ti∼p ( T ) LTi ( Dtei ; θ′i ) = ∑ Ti∼p ( T ) ∑ ( x , ẋ ) ∼Dtei ∥∥ẋ− Ω∇xHθ′i ( x ) ∥∥22 . ( 6 ) Depending on the inner-loop methods , we call the algorithms Hamiltonian Model-Agnostic MetaLearning ( HAMAML ) when using Equation 2 , and Hamiltonian Almost No Inner-Loop ( HANIL ) when using Equation 4 .

Summary: The paper presents a meta-learning method for learning Hamiltonian dynamic systems from data. More specifically, the novelty is incorporating Hamiltonian Neural Networks (HNNs) within known meta-learning methods (MAML and ANIL) in order to model new dynamical systems (with previously known structures but unknown parameters) from partially observed data. The results from the experimental evaluation (on three well-known systems) show that such an approach, and in particular HNNs w/ ANIL (HANIL), leads to more accurate models of unseen dynamics compared to other benchmarks methods such as "vanilla" HNNs and HNNs w/ MAML (HAMAML).