This repository contains the implementation of two RL algorithms: Proximal Policy Optimization (PPO) and Deep Q Learning (DQN) both from scratch (with PyTorch) and using the TorchRL library.
The environment is the car racing simulation from OpenAI's Gym package to train autonomous driving.
Example of an agent trained with the PyTorch implementation of PPO.
Create a virtual environment:
conda create -n NAME_OF_THE_ENVIRONEMNT python=3.8
conda activate NAME_OF_THE_ENVIRONEMNT
Clone the repository:
git clone https://github.com/bielnebot/rl_implementations.git
And install the requirements:
pip install -r requirements.txt
Algorithms | Implementation |
---|---|
PPO, DQN | PyTorch, TorchRL |
Choose an algorithm and an implementation from the available ones and run the main.py
module of its respective directory.
python car_racing\CHOSEN_ALGORITHM\CHOSEN_IMPLEMENTATION\main.py
Choose an algorithm and an implementation from the available ones and run the test_policy.py
module of its respective directory.
python car_racing\CHOSEN_ALGORITHM\CHOSEN_IMPLEMENTATION\test_policy.py
- DQN from scratch
- PPO from scratch
- PPO with TorchRL
- DQN with TorchRL