Skip to content

Latest commit

 

History

History
47 lines (39 loc) · 1.5 KB

README.md

File metadata and controls

47 lines (39 loc) · 1.5 KB

Reinforcement learning implementations

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.

trained_agent_demo Example of an agent trained with the PyTorch implementation of PPO.

Set up

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

Use

Algorithms Implementation
PPO, DQN PyTorch, TorchRL

To train a policy

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

To test a pre-trained policy

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

To-Do

  • DQN from scratch

Done

  • PPO from scratch
  • PPO with TorchRL
  • DQN with TorchRL