https://github.com/danijar/dreamer
Dream to Control: Learning Behaviors by Latent Imagination
https://github.com/danijar/dreamer
artificial-intelligence deep-learning reinforcement-learning robotics world-models
Last synced: 3 months ago
JSON representation
Dream to Control: Learning Behaviors by Latent Imagination
- Host: GitHub
- URL: https://github.com/danijar/dreamer
- Owner: danijar
- License: mit
- Created: 2020-01-27T18:19:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-10T20:49:29.000Z (almost 4 years ago)
- Last Synced: 2025-03-29T13:10:00.586Z (3 months ago)
- Topics: artificial-intelligence, deep-learning, reinforcement-learning, robotics, world-models
- Language: Python
- Homepage: https://danijar.com/dreamer
- Size: 43 KB
- Stars: 527
- Watchers: 11
- Forks: 109
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dream to Control
**NOTE:** Check out the code for [DreamerV2](https://github.com/danijar/dreamerv2), which supports both Atari and DMControl environments.
Fast and simple implementation of the Dreamer agent in TensorFlow 2.
If you find this code useful, please reference in your paper:
```
@article{hafner2019dreamer,
title={Dream to Control: Learning Behaviors by Latent Imagination},
author={Hafner, Danijar and Lillicrap, Timothy and Ba, Jimmy and Norouzi, Mohammad},
journal={arXiv preprint arXiv:1912.01603},
year={2019}
}
```## Method

Dreamer learns a world model that predicts ahead in a compact feature space.
From imagined feature sequences, it learns a policy and state-value function.
The value gradients are backpropagated through the multi-step predictions to
efficiently learn a long-horizon policy.- [Project website][website]
- [Research paper][paper]
- [Official implementation][code] (TensorFlow 1)[website]: https://danijar.com/dreamer
[paper]: https://arxiv.org/pdf/1912.01603.pdf
[code]: https://github.com/google-research/dreamer## Instructions
Get dependencies:
```
pip3 install --user tensorflow-gpu==2.2.0
pip3 install --user tensorflow_probability
pip3 install --user git+git://github.com/deepmind/dm_control.git
pip3 install --user pandas
pip3 install --user matplotlib
```Train the agent:
```
python3 dreamer.py --logdir ./logdir/dmc_walker_walk/dreamer/1 --task dmc_walker_walk
```Generate plots:
```
python3 plotting.py --indir ./logdir --outdir ./plots --xaxis step --yaxis test/return --bins 3e4
```Graphs and GIFs:
```
tensorboard --logdir ./logdir
```