A project implementing the dreamer world model in PyTorch. This repository can run experiments in both OpenAI gym and RaiSim.
Dreamer: https://danijar.com/project/dreamerv3/
OpenAI gym: https://www.gymlibrary.dev/
RaiSim: https://raisim.com/
To start using this repository, you must first have raisim installed. To do this, follow the instructions here:
https://raisim.com/sections/Installation.html. It is assumed that your installation directory is called $LOCAL_INSTALL
Once this is complete, clone the repository:
git clone --recurse-submodules [email protected]:reeceomahoney/world-models
Build:
mkdir build
cd build
cmake ..
make -j4
Then install python packages:
cd ..
pip install -r requirements.txt
To run an experiment, use the following command:
python scripts/ditto.py
By default this will run the DITTO algorithm in raisim. To run dreamer instead, add the flag --ditto False
. To change the environment to one from OpenAI gym, add the --env
flag followed by the name of the environment. To run from a prexisting agent add the --agent
flag followed by a path to the corrent .pt
file.
Logging can be done using tensorboard:
tensorboard --logdir <log_dir>
Finally, to test a pre-existing agent, run the following:
python scripts/run.py --agent <path_to_agent>