Deconstructing The Inductive Biases of Hamiltonian Neural Networks by Nate Gruver, Marc Finzi, Sam Stanton, and Andrew Gordon Wilson.
Our repo was constructed from https://github.com/mfinzi/constrained-hamiltonian-neural-networks.git
git clone https://github.com/ngruver/decon-hnn.git
cd decon-hnn
pip install -r requirements.txtgit clone https://github.com/ngruver/decon-hnn.git
cd decon-hnn
conda env create -f decon-hnn.ymlAll figures from the paper can be recreated by running the notebooks
These notebooks process data from the following wandb sweeps
All experimental data, and the associated configurations, are contained in these sweeps.
You can train the models NN (NODE), MechanicsNN (NODE + SO), and HNN using the model_type option as shown below.
python toy_systems.py --system_type "ChainPendulum" --model_type "NN"
python toy_systems.py --system_type "ChainPendulum" --model_type "MechanicsNN"
python toy_systems.py --system_type "ChainPendulum" --model_type "HNN"The other systems, with and without friction, can be specified as SpringPendulum, FrictionChainPendulum, and FrictionSpringPendulum.
To train models on mujoco, you must first download our saved mujoco trajectories with full state and velocity.
brew install gdrive
gdrive download 1Vdf8rjPXabfMaCouNfqUYf0ifDW3qAU2 --recursive
mv full_state_mujoco_trajs datapip install gshell
gshell init
gshell download --with-id '1Vdf8rjPXabfMaCouNfqUYf0ifDW3qAU2' --recursive
mv full_state_mujoco_trajs data
Once the data has been downloaded, NODE, CoupledNODE(NODE + SO), and MixtureHNN (SymODEN) models can be trained as shown below.
python mujoco.py --model_type "NODE" --task "HopperFull-v0"
python mujoco.py --model_type "CoupledNODE" --task "HopperFull-v0"
python mujoco.py --model_type "MixtureHNN" --task "HopperFull-v0"The other mujoco tasks included in the paper can be specified as SwimmerFull-v0 and HalfCheetahFull-v0
If you find our work helpful, please cite it with
@inproceedings{
gruver2022deconstructing,
title={Deconstructing the Inductive Biases of Hamiltonian Neural Networks},
author={Nate Gruver and Marc Anton Finzi and Samuel Don Stanton and Andrew Gordon Wilson},
booktitle={International Conference on Learning Representations},
year={2022},
url={https://openreview.net/forum?id=EDeVYpT42oS}
}