← 开源
facebookresearch

Pearl

A Production-ready Reinforcement Learning AI Agent Library brought by the Applied Reinforcement Learning team at Meta.

Model DevelopmentEnvironmentsJupyter Notebook
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
3.03k
Star
207
Fork
+0
本周
29
贡献者
创建于 2023-04-07 · 更新于 2026-10-03 · 今日第 8181 名
主要开发者
rodrigodesalvobrazyiwan-rljb3618

facebookresearch/Pearl 排名第 8,181,有 3,033 个星标。

同类别比较

facebookresearch/Pearl 排名第 8,181,此处有 8 个同类条目;tensorflow/agents 排名第 8,183。

同类别比较
名称排名指标
stellargraph/stellargraph8,166
语言:
Python
星标数:
3,064
分叉数:
441
简介:
StellarGraph - Machine Learning on Graphs
ieee8023/covid-chestxray-dataset8,168
语言:
Jupyter Notebook
星标数:
3,060
分叉数:
1,277
简介:
We are building an open database of COVID-19 cases with chest X-ray or CT images.
argman/EAST8,170
语言:
C++
星标数:
3,057
分叉数:
1,036
简介:
A tensorflow implementation of EAST text detector
maciejkula/spotlight8,173
语言:
Python
星标数:
3,048
分叉数:
416
简介:
Deep recommender models using PyTorch.
tensorflow/agents8,183
语言:
Python
星标数:
3,031
分叉数:
751
简介:
TF-Agents: A reliable, scalable and easy to use TensorFlow library for Contextual Bandits and Reinforcement Learning.
avinashpaliwal/Super-SloMo8,190
语言:
Python
星标数:
3,022
分叉数:
479
简介:
PyTorch implementation of Super SloMo by Jiang et al.
deepseek-ai/DualPipe8,193
语言:
Python
星标数:
3,018
分叉数:
334
简介:
A bidirectional pipeline parallelism algorithm for computation-communication overlap in DeepSeek V3/R1 training.
osmr/imgclsmob8,199
语言:
Python
星标数:
3,012
分叉数:
548
简介:
Sandbox for training deep learning networks
关键参数与规格
关键参数与规格
参数值
语言Jupyter Notebook
类别Model Development
子类别Environments
关键词RL
星标数3,033
分叉数207
贡献者29
创建日期2023-04-07
更新日期2026-10-03
1 天星标数0
7 天星标数0
排名8,181
上次排名8,247
排名变化66
7 天星标排名11,905
上次 7 天星标排名11,955
7 天星标排名变化50
总星标排名4,468
上次总星标排名4,463
总星标排名变化-5
国家USA
README 摘录

Pearl - A Production-ready Reinforcement Learning AI Agent Library Proudly brought by Applied Reinforcement Learning @ Meta v0. Announcements: Twitter Post, LinkedIn Post Highlighted on Meta NeurIPS 2023 Official Website: Website Highlighted by AI at Meta official handle on Twitter and LinkedIn: Twitter Post, LinkedIn Post. More details of the library at our official website. Our NeurIPS 2023 Presentation Slides is released here. Overview Pearl is a new production-ready Reinforcement Learning AI agent library open-sourced by the Applied Reinforcement

Learning team at Meta. Furthering our efforts on open AI innovation, Pearl enables researchers and practitioners to develop Reinforcement Learning AI agents. These AI agents prioritize cumulative long-term feedback over immediate feedback and can adapt to environments with limited observability, sparse feedback, and high stochasticity. We hope that Pearl offers the community a means to build state-of-the-art Reinforcement Learning AI agents that can adapt to a wide range of complex production environments. News January 22, 2025

- Pearl components serialization Pearl components can now produce state dicts just like PyTorch modules, and these state dicts can be saved and loaded with and ! Here's a basic example: Note that this works for subcomponents as well, such as , , etc. If your component has attributes that are not parameters, buffers, or sub-modules, they are not included automatically in the state dict. In those cases, (just like in PyTorch) define methods and for including such attributes in the state dict

(see, for example, ). When defining your own components, you must now define a method which returns a string listing the differences between two components (see, for example, ). This method serves as a general comparison method for testing purposes. Getting Started Installation To install Pearl, you can simply clone this repository and run (you need version ≥ 21. 3 and version ≥ 64): Quick Start To kick off a Pearl agent with a classic reinforcement learning environment, here's a quick example. Users can

replace the environment with any real-world problems. Tutorials We provide a few tutorial Jupyter notebooks (and are currently working on more! We derived a small contrived recommender system environment using the MIND dataset (Wu et al. Demonstrates contextual bandit algorithms and their implementation using Pearl using a contextual bandit environment for providing data from UCI datasets, and tested the performance of neural implementations of SquareCB, LinUCB, and LinTS. A simple example showing how to use a one-hot observation

wrapper to learn the classic problem with DQN. Demonstrates how to run DQN and Double DQN on the Cart-Pole environment. Actor-critic algorithms with safety constraints. Demonstrates how to run Actor Critic methods, including a version with safe constraints. Design and Features Pearl was built with a modular design so that industry practitioners or academic researchers can select any subset and flexibly combine features below to construct a Pearl agent customized for their specific use cases. Pearl offers a

diverse set of unique features for production environments, including dynamic action spaces, offline learning, intelligent neural exploration, safe decision making

常见问题

记录了多少星标和分叉?

facebookresearch/Pearl 有 3,033 个星标和 207 个分叉。

仓库排名是多少?

facebookresearch/Pearl 排名第 8,181。

记录的语言和类别是什么?

facebookresearch/Pearl 有 3,033 个星标,语言为 Jupyter Notebook,类别为 Model Development。

哪个仓库排名最接近?

facebookresearch/Pearl 与 tensorflow/agents 比较,后者排名第 8,183,有 3,031 个星标。

README

Pearl - A Production-ready Reinforcement Learning AI Agent Library

Proudly brought by Applied Reinforcement Learning @ Meta

More details of the library at our official website.

The Pearl paper is available at Arxiv.

Our NeurIPS 2023 Presentation Slides is released here.

Overview

Pearl is a new production-ready Reinforcement Learning AI agent library open-sourced by the Applied Reinforcement Learning team at Meta. Furthering our efforts on open AI innovation, Pearl enables researchers and practitioners to develop Reinforcement Learning AI agents. These AI agents prioritize cumulative long-term feedback over immediate feedback and can adapt to environments with limited observability, sparse feedback, and high stochasticity. We hope that Pearl offers the community a means to build state-of-the-art Reinforcement Learning AI agents that can adapt to a wide range of complex production environments.

News

January 22, 2025 - Pearl components serialization

Pearl components can now produce state dicts just like PyTorch modules, and these state dicts can be saved and loaded with torch.save and torch.load!

Here's a basic example:

agent = PearlAgent(...)
# Save the agent's state dict
torch.save(agent.state_dict(), 'agent_state.pth')

agent2 = PearlAgent(...)  # agent2 must have the same structure as agent
# Load the agent's state dict
agent2.load_state_dict(torch.load('agent_state.pth'))

assert agent2.compare(agent) == ""  # `compare` is a newly introduced method

Note that this works for subcomponents as well, such as PolicyLearner, ExplorationModule, etc.

If your component has attributes that are not parameters, buffers, or sub-modules, they are not included automatically in the state dict. In those cases, (just like in PyTorch) define methods get_extra_state and set_extra_state for including such attributes in the state dict (see, for example, ActorCriticBase.get_extra_state).

When defining your own components, you must now define a compare method which returns a string listing the differences between two components (see, for example, PearlAgent.compare). This method serves as a general comparison method for testing purposes.

Getting Started

Installation

To install Pearl, you can simply clone this repository and run pip install -e . (you need pip version ≥ 21.3 and setuptools version ≥ 64):

git clone https://github.com/facebookresearch/Pearl.git
cd Pearl
pip install -e .

Quick Start

To kick off a Pearl agent with a classic reinforcement learning environment, here's a quick example.

from pearl.pearl_agent import PearlAgent
from pearl.action_representation_modules.one_hot_action_representation_module import (
    OneHotActionTensorRepresentationModule,
)
from pearl.policy_learners.sequential_decision_making.deep_q_learning import (
    DeepQLearning,
)
from pearl.replay_buffers import (
    BasicReplayBuffer,
)
from pearl.utils.instantiations.environments.gym_environment import GymEnvironment

env = GymEnvironment("CartPole-v1")

num_actions = env.action_space.n
agent = PearlAgent(
    policy_learner=DeepQLearning(
        state_dim=env.observation_space.shape[0],
        action_space=env.action_space,
        hidden_dims=[64, 64],
        training_rounds=20,
        action_representation_module=OneHotActionTensorRepresentationModule(
            max_number_actions=num_actions
        ),
    ),
    replay_buffer=BasicReplayBuffer(10_000),
)

observation, action_space = env.reset()
agent.reset(observation, action_space)
done = False
while not done:
    action = agent.act(exploit=False)
    action_result = env.step(action)
    agent.observe(action_result)
    agent.learn()
    done = action_result.done

Users can replace the environment with any real-world problems.

Tutorials

We provide a few tutorial Jupyter notebooks (and are currently working on more!):

  1. A single item recommender system. We derived a small contrived recommender system environment using the MIND dataset (Wu et al. 2020).

  2. Contextual bandits. Demonstrates contextual bandit algorithms and their implementation using Pearl using a contextual bandit environment for providing data from UCI datasets, and tested the performance of neural implementations of SquareCB, LinUCB, and LinTS.

  3. Frozen Lake. A simple example showing how to use a one-hot observation wrapper to learn the classic problem with DQN.

  4. Deep Q-Learning (DQN) and Double DQN. Demonstrates how to run DQN and Double DQN on the Cart-Pole environment.

  5. Actor-critic algorithms with safety constraints. Demonstrates how to run Actor Critic methods, including a version with safe constraints.

Design and Features

Pearl was built with a modular design so that industry practitioners or academic researchers can select any subset and flexibly combine features below to construct a Pearl agent customized for their specific use cases. Pearl offers a diverse set of unique features for production environments, including dynamic action spaces, offline learning, intelligent neural exploration, safe decision making, history summarization, and data augmentation.

You can find many Pearl agent candidates with mix-and-match set of reinforcement learning features in utils/scripts/benchmark_config.py

Adoption in Real-world Applications

Pearl is in progress supporting real-world applications, including recommender systems, auction bidding systems and creative selection. Each of them requires a subset of features offered by Pearl. To visualize the subset of features used by each of the applications above, see the table below.

Pearl Features Recommender Systems Auction Bidding Creative Selection
Policy Learning ✅ ✅ ✅
Intelligent Exploration ✅ ✅ ✅
Safety ✅
History Summarization ✅
Replay Buffer ✅ ✅ ✅
Contextual Bandit ✅
Offline RL ✅ ✅
Dynamic Action Space ✅ ✅
Large-scale Neural Network ✅

Comparison to Other Libraries

Pearl Features Pearl ReAgent (Superseded by Pearl) RLLib SB3 Tianshou Dopamine
Agent Modularity ✅ ❌ ❌ ❌ ❌ ❌
Dynamic Action Space ✅ ✅ ❌ ❌ ❌ ❌
Offline RL ✅ ✅ ✅ ✅ ✅ ❌
Intelligent Exploration ✅ ❌ ❌ ❌ ⚪ (limited support) ❌
Contextual Bandit ✅ ✅ ⚪ (only linear support) ❌ ❌ ❌
Safe Decision Making ✅ ❌ ❌ ❌ ❌ ❌
History Summarization ✅ ❌ ✅ ❌ ⚪ (requires modifying environment state) ❌
Data Augmented Replay Buffer ✅ ❌ ✅ ✅ ✅ ❌

Cite Us

@article{pearl2023paper,
    title = {Pearl: A Production-ready Reinforcement Learning Agent},
    author = {Zheqing Zhu, Rodrigo de Salvo Braz, Jalaj Bhandari, Daniel Jiang, Yi Wan, Yonathan Efroni, Ruiyang Xu, Liyuan Wang, Hongbo Guo, Alex Nikulkov, Dmytro Korenkevych, Urun Dogan, Frank Cheng, Zheng Wu, Wanqiao Xu},
    eprint = {arXiv preprint arXiv:2312.03814},
    year = {2023}
}

License

Pearl is MIT licensed, as found in the LICENSE file.

排名相邻
同类项目