Skip to content

🤖 PPO and DQN reinforcement learning algorithms implemented with PyTorch and TorchRL for autonomous driving.

License

Notifications You must be signed in to change notification settings

bielnebot/rl_implementations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🤖 PPO and DQN reinforcement learning algorithms implemented with PyTorch and TorchRL for autonomous driving.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages