First, create the environment with the python 3.12. For conda, use
conda create -n drl python=3.12
where you can rename the environment name drl. Then enter the env:
conda activate drl
Second, install the required libs:
python -m pip install -r requirements.txt
Since Box2D (installed via gymnasium[box2d]) is a C++ extension, we do not
recommend using the uv environment tool that for pure pyhton env.
All commands are run under the project root. If it can not fing the module path, you can try (add project root to the python path):
export PYTHONPATH=$PYTHONPATH:$(pwd)
To ensure your code is high-quality, please use the pre-commit:
- when you submit a
git commit:- it will run a range of checks.
- include self-add mypy check.
- commit will be submited when it passes all checks.
Run below command in terminal to install the pre-commit for git commit.
pre-commit install
where you can uninstall it by pre-commit unstall.
You also can run mypy and pytest seperately. Some commands:
mypy .
mypy hands_on/exercise1_q_learning/q_learing_train.py
pytest .
pytest -s common/
pytest -s $FOLDER$ -k $function_name$
Check the specified environment:
- Change the env to what you want in the env_test.py file
- run the below command to see whether your laptop work.
python practice/sandbox/env_test.py
Launch TensorBoard to view training metrics with run the below command in terminal:
tensorboard --logdir=Exercise_Result_Folder
For example
tensorboard --logdir=results/exercise3_reinforce/cartpole/tensorboard
- q_learning
- dqn
- vanilla reinforce
- curiosity with enhanced reinforce
- A2C with GAE
- A3C
- PPO
- TD3
- SAC
- PPO+Curiosity+DDP
- SAC+PER+DDP
CLI_README: the design document for the command cli.