Hamiltonian neural networks draw inspiration from Hamiltonian mechanics, a branch of physics concerned with conservation laws and invariances. By construction, these models learn conservation laws from data, revealing major advantages over regular neural networks on a variety of physics problems.