Skip to main content

A library for Reinforcement Learning

Project description

# anyrl-py

This is a Python remake (and makeover) of [anyrl](https://github.com/unixpickle/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
```


Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anyrl-0.12.13.tar.gz (64.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anyrl-0.12.13-py3-none-any.whl (89.0 kB view details)

Uploaded Python 3

File details

Details for the file anyrl-0.12.13.tar.gz.

File metadata

  • Download URL: anyrl-0.12.13.tar.gz
  • Upload date:
  • Size: 64.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1

File hashes

Hashes for anyrl-0.12.13.tar.gz
Algorithm Hash digest
SHA256 90bc4cdfb8e3a7214164dfc6a75ecbe04722670e7ce54cde0aad4aab0e9e49a7
MD5 7bc1999daec889b29008e61a9d597930
BLAKE2b-256 3a6bbc1b9a959b341b1c59ddc79a6e4a4c13f767aa52ca652ebbd98c28ac1df9

See more details on using hashes here.

File details

Details for the file anyrl-0.12.13-py3-none-any.whl.

File metadata

  • Download URL: anyrl-0.12.13-py3-none-any.whl
  • Upload date:
  • Size: 89.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1

File hashes

Hashes for anyrl-0.12.13-py3-none-any.whl
Algorithm Hash digest
SHA256 51347f15625379a091000dda909b77de2cd7ea04d08bc195ced70113aef65eb0
MD5 53d1c37b632668117b85b72dd11f57f0
BLAKE2b-256 ce8631561e98be4138114fa447605b465229f255683f3b504edd8d4b47bcdba0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page