• Stars
    star
    402
  • Rank 107,380 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A PyTorch reinforcement learning library for generalizable and reproducible algorithm implementations with an aim to improve accessibility in RL



pypi PyPI pyversions Downloads codecov GitHub license

Language grade: Python Maintainability CodeFactor Total alerts

Build Status Documentation Status Tests MacOS Tests Linux Tests Windows

Slack - Chat


GenRL is a PyTorch reinforcement learning library centered around reproducible, generalizable algorithm implementations and improving accessibility in Reinforcement Learning

GenRL's current release is at v0.0.2. Expect breaking changes

Reinforcement learning research is moving faster than ever before. In order to keep up with the growing trend and ensure that RL research remains reproducible, GenRL aims to aid faster paper reproduction and benchmarking by providing the following main features:

  • PyTorch-first: Modular, Extensible and Idiomatic Python
  • Tutorials and Example: 20+ Tutorials from basic RL to SOTA Deep RL algorithm (with explanations)!
  • Unified Trainer and Logging class: code reusability and high-level UI
  • Ready-made algorithm implementations: ready-made implementations of popular RL algorithms.
  • Faster Benchmarking: automated hyperparameter tuning, environment implementations etc.

By integrating these features into GenRL, we aim to eventually support any new algorithm implementation in less than 100 lines.

If you're interested in contributing, feel free to go through the issues and open PRs for code, docs, tests etc. In case of any questions, please check out the Contributing Guidelines

Installation

GenRL is compatible with Python 3.6 or later and also depends on pytorch and openai-gym. The easiest way to install GenRL is with pip, Python's preferred package installer.

$ pip install genrl

Note that GenRL is an active project and routinely publishes new releases. In order to upgrade GenRL to the latest version, use pip as follows.

$ pip install -U genrl

If you intend to install the latest unreleased version of the library (i.e from source), you can simply do:

$ git clone https://github.com/SforAiDl/genrl.git
$ cd genrl
$ python setup.py install

Usage

To train a Soft Actor-Critic model from scratch on the Pendulum-v0 gym environment and log rewards on tensorboard

import gym

from genrl.agents import SAC
from genrl.trainers import OffPolicyTrainer
from genrl.environments import VectorEnv

env = VectorEnv("Pendulum-v0")
agent = SAC('mlp', env)
trainer = OffPolicyTrainer(agent, env, log_mode=['stdout', 'tensorboard'])
trainer.train()

To train a Tabular Dyna-Q model from scratch on the FrozenLake-v0 gym environment and plot rewards:

import gym

from genrl.agents import QLearning
from genrl.trainers import ClassicalTrainer

env = gym.make("FrozenLake-v0")
agent = QLearning(env)
trainer = ClassicalTrainer(agent, env, mode="dyna", model="tabular", n_episodes=10000)
episode_rewards = trainer.train()
trainer.plot(episode_rewards)

Tutorials

Algorithms

Deep RL

  • DQN (Deep Q Networks)
    • DQN
    • Double DQN
    • Dueling DQN
    • Noisy DQN
    • Categorical DQN
  • VPG (Vanilla Policy Gradients)
  • A2C (Advantage Actor-Critic)
  • PPO (Proximal Policy Optimization)
  • DDPG (Deep Deterministic Policy Gradients)
  • TD3 (Twin Delayed DDPG)
  • SAC (Soft Actor Critic)

Classical RL

  • SARSA
  • Q Learning

Bandit RL

  • Multi Armed Bandits
    • Eps Greedy
    • UCB
    • Thompson Sampling
    • Bayesian Bandits
    • Softmax Explorer
  • Contextual Bandits
    • Eps Greedy
    • UCB
    • Thompson Sampling
    • Bayesian Bandits
    • Softmax Explorer
  • Deep Contextual Bandits
    • Variation Inference
    • Noise sampling for neural network parameters
    • Epsilon greedy with a neural network
    • Bayesian Regression on for posterior inference
    • Bootstraped Ensemble

Credits and Similar Libraries:

More Repositories

1

KD_Lib

A Pytorch Knowledge Distillation library for benchmarking and extending works in the domains of Knowledge Distillation, Pruning, and Quantization.
Python
593
star
2

Neural-Voice-Cloning-With-Few-Samples

This repository has implementation for "Neural Voice Cloning With Few Samples"
Python
428
star
3

vformer

A modular PyTorch library for vision transformer models
Python
163
star
4

Deep-Learning-TIP

Jupyter Notebook
26
star
5

Summer-Induction-Assignment-2021

Repository for SAiDL Summer 2021 Induction Assignment
21
star
6

paper-reading-group

Notes for papers presented during our paper reading sessions
20
star
7

SAiDL-Summer-2023-Induction-Assignment

18
star
8

Playground

A python library consisting of pipelines for visual analysis of different sports using Computer Vision and Deep Learning.
Python
18
star
9

CountCLIP

Jupyter Notebook
16
star
10

jeta

A Jax based meta learning library
Python
16
star
11

decepticonlp

Python Library for Robustness Monitoring and Adversarial Debugging of NLP models
Python
15
star
12

Summer-Induction-Assignment-2020

Repository for SAiDL Summer Assignment 2020
Python
14
star
13

SAiDL-Spring-2024-Induction-Assignment

13
star
14

SAiDL-Spring-2022-Induction-Assignment

Repository for SAiDL Spring 2022 Induction Assignment
12
star
15

neuroscience-ai-reading-course

Notes for the Neuroscience & AI Reading Course (SEM-I 2020-21) at BITS Pilani Goa Campus
12
star
16

saliency_estimation

Python library to estimate saliency
Python
8
star
17

SAiDL-Season-of-Code

6
star
18

twitter-sanity

A python tool to recommend relevant and important tweets from your Twitter feed.
Python
6
star
19

evis

A utility Python library for event-based vision
Python
5
star
20

NeurIPS2020

5
star
21

Winter-Assignment-2019

Winter Assignment 2019
2
star
22

Bootcamp

Python + ML Bootcamp
Jupyter Notebook
2
star
23

Winter-Assignment-2018

1
star
24

blogs

1
star