This project provides the open source implementation of the CDE in the paper: "Learning from Sparse Offline Datasets via Conservative Density Estimation"
- We recommend to use Anaconda or Miniconda to manage python environment.
- Install
mujocoandmujoco-py, your can either refer to https://github.com/openai/mujoco-py or runIt is also necessary to add below towget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz tar -xvf mujoco210-linux-x86_64.tar.gz mkdir .mujoco mv mujoco210 ~/.mujoco/mujoco210~/.bashrc:We have includedexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mujoco210/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia
mujoco-pyinrequirements.txtbut you may need to installlibglew-dev, patchelfwhen compiling themujoco-pyafter the installation:sudo apt-get install libglew-dev sudo apt-get install patchelf
- Create conda env:
cd cde-offline-rl conda env create -f environment.yaml conda activate cde - Install PyTorch according to your platform and cuda version.
- Install D4rl from https://github.com/Farama-Foundation/D4RL.
To run a single experiment, take maze2d-medium-v1 for example, run
python run_cde.py --env_name "maze2d-medium-v1" --hyperparams 'hyper_params/cde/maze2d.yaml' --cudaid 0 --seed 100where --hyperparams specifies the hyperparameter files in directory ./hyper_params/, --cudaid specifies which gpu will be used for training (the defaulted -1 means using cpu).
If you want to run multiple experiments, we have also included some other training commands in bash file run_exp.sh. You can consider using & to run the commands in parallel.