├── .colorize ├── .gitignore ├── .gitmodules ├── README.md ├── TestEnergyFunction.ipynb ├── TestPendulumGeneration.ipynb ├── VisualizePendulumCache.ipynb ├── datasets ├── imagepairs.py ├── images.py └── pendulum.py ├── models ├── pendulum_energy.py ├── simple.py ├── stabledynamics.py ├── sympy2torch.py ├── train_many ├── vae.py └── vae_trajectory.py ├── pendulum_error.py ├── plot_data.py ├── render.py ├── render_vae ├── requirements.txt ├── test_lstm.py ├── train.py ├── train_lstm.py ├── train_many ├── train_pendulum_simple ├── train_pendulum_stable ├── train_pendulum_stable_knownV ├── train_vae_simple ├── train_vae_stable ├── trajectory.py ├── util.py └── vae_trajmodel.py /.colorize: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ("$@" 2>&1>&3 | sed -e $'s,\[[0-9:]* INFO.*,\e[93m&\e[m,' -e $'s,\[[0-9:]* INFO @root].*,\e[36m&\e[m,' -e $'s,\[[0-9:]* WARNING.*,\e[91m&\e[m,' -e $'s,\[[0-9:]* ERROR.*,\e[41m&\e[m,' >&2) 3>&1 | sed $'s,.*,\e[m&\e[m,' 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .python-version 2 | .vscode/ 3 | *.log 4 | 5 | youtube 6 | experiments/ 7 | pendulum-cache/ 8 | runs/ 9 | 10 | **/__pycache__/ 11 | .ipynb_checkpoints 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "models/ritheshkumar95_vqvae"] 2 | path = models/ritheshkumar95_vqvae 3 | url = git@github.com:ritheshkumar95/pytorch-vqvae.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Learning Stable Deep Dynamics Models 2 | 3 | Companion code to "Learning Stable Deep Dynamics Models" (Manek and Kolter, 2019) 4 | 5 | ## Installation 6 | 7 | You need Python 3.6 or later, with packages listed in `requirements.txt`. Ensure that the directories `experiments/` and `runs/` are writable. 8 | 9 | ## Running 10 | 11 | All training commands produce output in the `experiments/` folder, automatically named with the hyperparameters used in training. You can track training progress using `tensorboard runs/`. 12 | 13 | ### Pendulum 14 | 15 | To train the models for an ``-link pendulum, you should first run the command: 16 | 17 | ```sh 18 | ./train_pendulum_simple 19 | ``` 20 | 21 | which will create and cache the training data and the evaluation data. (Warning: this is a cpu-heavy task that may take hours to complete.) Once that is complete, you can train multiple models in parallel with: 22 | 23 | ```sh 24 | ./train_many 25 | ``` 26 | 27 | You can concurrently train train models with different ``. 28 | 29 | Ensure that `pendulum-cache/` is writable. 30 | 31 | ### VAE 32 | 33 | To train the VAE, you need to convert videos to sequentially-numbered frames in `youtube/