GithubHelp home page GithubHelp logo

adityakapoor74 / genrl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sforaidl/genrl

0.0 1.0 0.0 7.91 MB

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

Home Page: https://genrl.readthedocs.io

License: MIT License

Python 100.00%

genrl's Introduction



pypi GitHub license Build Status Total alerts Language grade: Python codecov Documentation Status Maintainability Lint, Test, Code Coverage Slack - Chat



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

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:

genrl's People

Contributors

sharad24 avatar ajaysub110 avatar sampreet-arthi avatar het-shah avatar threewisemonkeys-as avatar devanshu24 avatar hades-rp2010 avatar darshan-ko avatar tmorville avatar adityakapoor74 avatar duttaani avatar darylrodrigo avatar ishandaga avatar someshsingh22 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.