Skip to main content
QUICK REVIEW

[Paper Review] Hamiltonian Neural Networks

Sam Greydanus, Misko Dzamba|arXiv (Cornell University)|Jun 4, 2019
Machine Learning in Materials Science43 references315 citations
TL;DR

The paper introduces Hamiltonian Neural Networks (HNNs) that learn a parametric Hamiltonian to enforce energy conservation in dynamical systems, achieving better long-term fidelity and exact reversibility compared to baseline networks.

ABSTRACT

Even though neural networks enjoy widespread use, they still struggle to learn the basic laws of physics. How might we endow them with better inductive biases? In this paper, we draw inspiration from Hamiltonian mechanics to train models that learn and respect exact conservation laws in an unsupervised manner. We evaluate our models on problems where conservation of energy is important, including the two-body problem and pixel observations of a pendulum. Our model trains faster and generalizes better than a regular neural network. An interesting side effect is that our model is perfectly reversible in time.

Motivation & Objective

  • Motivate the need for physics-informed inductive biases in neural networks.
  • Propose learning a Hamiltonian function with a neural network to enforce conservation laws unsupervisedly.
  • Demonstrate improved long-term dynamics and energy conservation across multiple physics tasks.

Proposed method

  • Parameterize the Hamiltonian H_theta as a neural network that maps coordinates (q, p) to a scalar energy-like value.
  • Compute the symplectic gradient S_H = (∂H/∂p, -∂H/∂q) to obtain time derivatives and integrate with a RK4 solver.
  • Train using an in-graph gradient loss L_HNN = ||∂H/∂p - dq/dt||_2 + ||∂H/∂q + dp/dt||_2 to enforce exact conservation laws.
  • Evaluate on tasks including ideal mass-spring, ideal pendulum, real pendulum, two-body problem, and pixel-based pendulum dynamics.
  • Extend to pixel observations by coupling an autoencoder with the HNN and adding a latent-space loss to encourage Hamiltonian structure.

Experimental results

Research questions

  • RQ1Can a neural network learn a Hamiltonian that enforces energy conservation in dynamical systems?
  • RQ2Do Hamiltonian Neural Networks generalize and preserve energy better than standard neural networks across simple and complex physical tasks?
  • RQ3Can HNNs be trained from pixel data to model dynamical systems?
  • RQ4How does incorporating Hamiltonian structure affect reversibility and long-term stability of learned dynamics.

Key findings

  • HNNs learn an energy-like conserved quantity and substantially reduce energy drift over time compared to baselines.
  • On all five tasks, HNNs achieve similar train/test losses as baselines but much better energy conservation (energy MSE orders of magnitude lower in several tasks).
  • HNNs scale to larger systems (e.g., two-body problem) with strong energy conservation and slower divergence than baselines.
  • Pixel-based experiments show the HNN can learn dynamics from latent representations and preserve energy better than baselines over hundreds of frames.
  • The conserved quantity in HNNs closely mirrors total energy (up to a constant factor), indicating the learned Hamiltonian captures the essential physics.

Better researchstarts right now

From paper design to paper writing, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.