Dream to Control: Learning Behaviors by Latent Imagination
Paper: https://arxiv.org/abs/1912.01603
Project Website: https://danijar.com/project/dreamer/
TensorFlow 2 implementation: https://github.com/danijar/dreamer
TensorFlow 1 implementation: https://github.com/google-research/dreamer
- Clone the rlpyt framework with
git clone https://github.com/astooke/rlpyt.git
and copy therlpyt
sub-directory into this directory. - Or install directly from github with
pip install git+https://github.com/astooke/rlpyt.git
Other rlpyt requirements
- psutil:
pip install psutil
- pyprind:
pip install pyprind
(you may need --user flag when installing with pip)
Install PyTorch according to their website
Install gym with pip install gym
Install tensorboard with pip install tensorboard
or install TensorFlow
To run tests, install pytest: pip install pytest
For any other requirements do pip install -r requirements.txt
pip install atari_py
opencv:
- anaconda: https://anaconda.org/conda-forge/opencv
- pip:
pip install opencv-python
Only linux is supported. Follow instructions on dm_control
pip install mujoco_py
pip install dm_control
You must have a mujoco license
To run experiments on Atari, run python main.py
, and add any extra arguments you would like.
For example, to run with a single gpu set --cuda-idx 0
.
To run experiments on DeepMind Control, run python main_dmc.py
. You can also set any extra arguments here.
Experiments will automatically be stored in data/local/yyyymmdd/run_#
You can use tensorboard to keep track of your experiment.
Run tensorboard --logdir=data
.
If you have trouble reproducing any results, please raise a GitHub issue with your logs and results. Otherwise, if you have success, please share your trained model weights with us and with the broader community!
To run tests:
pytest tests
If you want additional code coverage information:
pytest tests --cov=dreamer
main.py
run atari experimentmain_dmc.py
run deepmind control experimentdreamer
dreamer codeagents
agent code used in samplingatari_dreamer_agent.py
Atari agentdmc_dreamer_agent.py
DeepMind Control agentdreamer_agent.py
basic sampling agent, exploration, contains shared methods
algos
algorithm specific codedreamer_algo.py
optimization algorithm, loss functions, hyperparametersreplay.py
replay buffer
envs
environment specific codeaction_repeat.py
action repeat wrapper. ported from tf2 dreameratari.py
Atari environments. ported from tf2 dreamerdmc.py
DeepMind Control Suite environment. ported from tf2 dreamerenv.py
base classes for environmentmodified_atari.py
unused atari environment from rlpytnormalize_actions.py
normalize actions wrapper. ported from tf2 dreamerone_hot.py
one hot action wrapper. ported from tf2 dreamertime_limit.py
Time limit wrapper. ported from tf2 dreamerwrapper.py
Base environment wrapper class
experiments
currently not usedmodels
all models used in the agentaction.py
Action modelagent.py
Summarizes all models for agent moduledense.py
Dense fully connected models. Used for Reward Model, Value Model, Discount Model.distribution.py
Distributions, TanH Bijectorobservation.py
Observation Modelrnns.py
Recurrent State Space Model
utils
utility functionslogging.py
logging videosmodule.py
freezing parameters
Read CONTRIBUTING.md
.
Contact juliusf@bu.edu or send in a pull request.
Join our slack link
(updated 5/19/2020)