Giter VIP home page Giter VIP logo

anyrl-py's Introduction

anyrl-py

This is a Python remake (and makeover) of anyrl. It is a general-purpose library for Reinforcement Learning which aims to be as modular as possible.

Installation

You can install anyrl with pip:

pip install anyrl

APIs

There are several different sub-modules in anyrl:

  • models: abstractions and concrete implementations of RL models. This includes actor-critic RNNs, MLPs, CNNs, etc. Takes care of sequence padding, BPTT, etc.
  • envs: APIs for dealing with environments, including wrappers and asynchronous environments.
  • rollouts: APIs for gathering and manipulating batches of episodes or partial episodes. Many RL algorithms include a "gather trajectories" step, and this sub-module fulfills that role.
  • algos: well-known learning algorithms like policy gradients or PPO. Also includes mini-algorithms like Generalized Advantage Estimation.
  • spaces: tools for using action and observation spaces. Includes parameterized probability distributions for implementing stochastic policies.

Motivation

Currently, most RL code out there is very restricted and not properly decoupled. In contrast, anyrl aims to be extremely modular and flexible. The goal is to decouple agents, learning algorithms, trajectories, and things like GAE.

For example, anyrl decouples rollouts from the learning algorithm (when possible). This way, you can gather rollouts in several different ways and still feed the results into one learning algorithm. Further, and more obviously, you don't have to rewrite rollout code for every new RL algorithm you implement. However, algorithms like A3C and Evolution Strategies may have specific ways of performing rollouts that can't rely on the rollout API.

Use of TensorFlow

This project relies on TensorFlow for models and training algorithms. However, anyrl APIs are framework-agnostic when possible. For example, the rollout API can be used with any policy, whether it's a TensorFlow neural network or a native-Python decision forest.

Style

I use autopep8 and pylint. Here is the command you can use to run autopep8:

autopep8 --recursive --in-place --max-line-length 100 .

I recommend the following lines in your pylintrc:

ignored-modules=numpy,mpi4py

disable=C,R

TODO

Here is the current TODO list, organized by sub-module:

  • models
    • Unify CNN and MLP models with a single base class.
    • Unshared actor-critics for TRPO and the like.
  • rollouts
    • Optimize for sub-batches in BatchedPlayer.
  • algos
    • TRPO
    • PPO: allow clipping for value function
  • spaces
    • Dict
  • tests
    • Benchmarks for rollouts
    • Benchmarks for training

anyrl-py's People

Contributors

unixpickle avatar

Watchers

James Cloos avatar Steven Du avatar  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.