Skip to main content

English | 简体中文

Documentation Status Documentation Status Documentation Status Release

PARL is a flexible and high-efficient reinforcement learning framework.

About PARL

Features

Reproducible. We provide algorithms that stably reproduce the result of many influential reinforcement learning algorithms.

Large Scale. Ability to support high-performance parallelization of training with thousands of CPUs and multi-GPUs.

Reusable. Algorithms provided in the repository could be directly adapted to a new task by defining a forward network and training mechanism will be built automatically.

Extensible. Build new algorithms quickly by inheriting the abstract class in the framework.

Abstractions

PARL aims to build an agent for training algorithms to perform complex tasks.
The main abstractions introduced by PARL that are used to build an agent recursively are the following:

Model

Model is abstracted to construct the forward network which defines a policy network or critic network given state as input.

Algorithm

Algorithm describes the mechanism to update parameters in Model and often contains at least one model.

Agent

Agent, a data bridge between the environment and the algorithm, is responsible for data I/O with the outside environment and describes data preprocessing before feeding data into the training process.

Note: For more information about base classes, please visit our tutorial and API documentation.

Parallelization

PARL provides a compact API for distributed training, allowing users to transfer the code into a parallelized version by simply adding a decorator. For more information about our APIs for parallel training, please visit our documentation.
Here is a Hello World example to demonstrate how easy it is to leverage outer computation resources.

#============Agent.py=================
@parl.remote_class
class Agent(object):

    def say_hello(self):
        print("Hello World!")

    def sum(self, a, b):
        return a+b

parl.connect('localhost:8037')
agent = Agent()
agent.say_hello()
ans = agent.sum(1,5) # it runs remotely, without consuming any local computation resources

Two steps to use outer computation resources:

  1. use the parl.remote_class to decorate a class at first, after which it is transferred to be a new class that can run in other CPUs or machines.
  2. call parl.connect to initialize parallel communication before creating an object. Calling any function of the objects does not consume local computation resources since they are executed elsewhere.

As shown in the above figure, real actors (orange circle) are running at the cpu cluster, while the learner (blue circle) is running at the local gpu with several remote actors (yellow circle with dotted edge).

For users, they can write code in a simple way, just like writing multi-thread code, but with actors consuming remote resources. We have also provided examples of parallized algorithms like IMPALA, A2C. For more details in usage please refer to these examples.

Install:

Dependencies

  • Python 3.6+(Python 3.8+ is preferable for distributed training).
  • paddlepaddle>=2.3.1 (Optional, if you only want to use APIs related to parallelization alone)
pip install parl

Getting Started

Several-points to get you started:

For beginners who know little about reinforcement learning, we also provide an introductory course: ( Video | Code )

Examples

Metadata

Release files for parl 2.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parl 2.2.1
File Size Uploaded
parl-2.2.1.tar.gz 533.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for parl 2.2.1
File Interpreter ABI Platform
parl-2.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / parl-2.2.1.tar.gz

Download URL parl-2.2.1.tar.gz
Size 533.9 kB
Tags Source
SHA-256 checksum
How to use checksums
07b1ef9433da33d1a01f28ca0d1a0f8181d29fb4c01649597f9bdecdbef51abf
BLAKE2b-256 checksum
How to use checksums
4cb0100a014719bcbb77bd24bc653beb7c7c30d21303d1ef9c8af3d7f9ffa257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / parl-2.2.1-py3-none-any.whl

Download URL parl-2.2.1-py3-none-any.whl
Size 640.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b2ca55d5440f94b64093647a7608df021a5ab0730e9aa0c80a6f96ad16690de
BLAKE2b-256 checksum
How to use checksums
bbda4fb1457c29d9ca15da42134ad75683860b626af2f14fd39690552dd6f88c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

2.2.1 This release

2 release files

2.2

2 release files

2.1.1

2 release files

2.1

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page