All Projects → learnables → Cherry

learnables / Cherry

Licence: apache-2.0
A PyTorch Library for Reinforcement Learning Research

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Cherry

Amazon Sagemaker Examples
Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
Stars: ✭ 6,346 (+4337.76%)
Mutual labels:  learning, reinforcement-learning, rl
Awesome Monte Carlo Tree Search Papers
A curated list of Monte Carlo tree search papers with implementations.
Stars: ✭ 387 (+170.63%)
Mutual labels:  learning, reinforcement-learning, rl
Awesome Ai Books
Some awesome AI related books and pdfs for learning and downloading, also apply some playground models for learning
Stars: ✭ 855 (+497.9%)
Mutual labels:  learning, reinforcement-learning
Artificialintelligenceengines
Computer code collated for use with Artificial Intelligence Engines book by JV Stone
Stars: ✭ 35 (-75.52%)
Mutual labels:  learning, reinforcement-learning
Muzero General
MuZero
Stars: ✭ 1,187 (+730.07%)
Mutual labels:  reinforcement-learning, rl
Rosettastone
Hearthstone simulator using C++ with some reinforcement learning
Stars: ✭ 510 (+256.64%)
Mutual labels:  reinforcement-learning, rl
Rl Baselines Zoo
A collection of 100+ pre-trained RL agents using Stable Baselines, training and hyperparameter optimization included.
Stars: ✭ 839 (+486.71%)
Mutual labels:  reinforcement-learning, rl
Trading Gym
A Trading environment base on Gym
Stars: ✭ 71 (-50.35%)
Mutual labels:  reinforcement-learning, rl
Elf
ELF: a platform for game research with AlphaGoZero/AlphaZero reimplementation
Stars: ✭ 3,240 (+2165.73%)
Mutual labels:  reinforcement-learning, rl
Doom Net Pytorch
Reinforcement learning models in ViZDoom environment
Stars: ✭ 113 (-20.98%)
Mutual labels:  learning, reinforcement-learning
Aws Robomaker Sample Application Deepracer
Use AWS RoboMaker and demonstrate running a simulation which trains a reinforcement learning (RL) model to drive a car around a track
Stars: ✭ 105 (-26.57%)
Mutual labels:  reinforcement-learning, rl
Stable Baselines
Mirror of Stable-Baselines: a fork of OpenAI Baselines, implementations of reinforcement learning algorithms
Stars: ✭ 115 (-19.58%)
Mutual labels:  reinforcement-learning, rl
Mushroom Rl
Python library for Reinforcement Learning.
Stars: ✭ 442 (+209.09%)
Mutual labels:  reinforcement-learning, rl
Irl Imitation
Implementation of Inverse Reinforcement Learning (IRL) algorithms in python/Tensorflow. Deep MaxEnt, MaxEnt, LPIRL
Stars: ✭ 333 (+132.87%)
Mutual labels:  reinforcement-learning, rl
Pytorch Rl
Tutorials for reinforcement learning in PyTorch and Gym by implementing a few of the popular algorithms. [IN PROGRESS]
Stars: ✭ 121 (-15.38%)
Mutual labels:  reinforcement-learning, rl
Nlg Rl
Accelerated Reinforcement Learning for Sentence Generation by Vocabulary Prediction
Stars: ✭ 59 (-58.74%)
Mutual labels:  reinforcement-learning, rl
Rad
RAD: Reinforcement Learning with Augmented Data
Stars: ✭ 268 (+87.41%)
Mutual labels:  reinforcement-learning, rl
Drq
DrQ: Data regularized Q
Stars: ✭ 268 (+87.41%)
Mutual labels:  reinforcement-learning, rl
Rlenv.directory
Explore and find reinforcement learning environments in a list of 150+ open source environments.
Stars: ✭ 79 (-44.76%)
Mutual labels:  reinforcement-learning, rl
Ros2learn
ROS 2 enabled Machine Learning algorithms
Stars: ✭ 119 (-16.78%)
Mutual labels:  reinforcement-learning, rl


Build Status

Cherry is a reinforcement learning framework for researchers built on top of PyTorch.

Unlike other reinforcement learning implementations, cherry doesn't implement a single monolithic interface to existing algorithms. Instead, it provides you with low-level, common tools to write your own algorithms. Drawing from the UNIX philosophy, each tool strives to be as independent from the rest of the framework as possible. So if you don't like a specific tool, you don’t need to use it.

Features

  • Pythonic and low-level interface à la Pytorch.
  • Support for tabular (!) and function approximation algorithms.
  • Various OpenAI Gym environment wrappers.
  • Helper functions for popular algorithms. (e.g. A2C, DDPG, TRPO, PPO, SAC)
  • Logging, visualization, and debugging tools.
  • Painless and efficient distributed training on CPUs and GPUs.
  • Unit, integration, and regression tested, continuously integrated.

To learn more about the tools and philosophy behind cherry, check out our Getting Started tutorial.

Example

The following snippet showcases some of the tools offered by cherry.

import cherry as ch

# Wrap environments
env = gym.make('CartPole-v0')
env = ch.envs.Logger(env, interval=1000)
env = ch.envs.Torch(env)

policy = PolicyNet()
optimizer = optim.Adam(policy.parameters(), lr=1e-2)
replay = ch.ExperienceReplay()  # Manage transitions

for step in range(1000):
    state = env.reset()
    while True:
        mass = Categorical(policy(state))
        action = mass.sample()
        log_prob = mass.log_prob(action)
        next_state, reward, done, _ = env.step(action)

        # Build the ExperienceReplay
        replay.append(state, action, reward, next_state, done, log_prob=log_prob)
        if done:
            break
        else:
            state = next_state

    # Discounting and normalizing rewards
    rewards = ch.td.discount(0.99, replay.reward(), replay.done())
    rewards = ch.normalize(rewards)

    loss = -th.sum(replay.log_prob() * rewards)
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()
    replay.empty()

Many more high-quality examples are available in the examples/ folder.

Installation

Note Cherry is considered in early alpha release. Stuff might break.

pip install cherry-rl

Changelog

A human-readable changelog is available in the CHANGELOG.md file.

Documentation

Documentation and tutorials are available on cherry’s website: http://cherry-rl.net.

Contributing

First, thanks for your consideration in contributing to cherry. Here are a couple of guidelines we strive to follow.

  • It's always a good idea to open an issue first, where we can discuss how to best proceed.
  • If you want to contribute a new example using cherry, it would preferably stand in a single file.
  • If you would like to contribute a new feature to the core library, we suggest to first implement an example showcasing your new functionality. Doing so is quite useful:
    • it allows for automatic testing,
    • it ensures that the functionality is correctly implemented,
    • it shows users how to use your functionality, and
    • it gives a concrete example when discussing the best way to merge your implementation.

We don't have forums, but are happy to discuss with you on slack. Make sure to send an email to [email protected] to get an invite.

Acknowledgements

Cherry draws inspiration from many reinforcement learning implementations, including

Why 'cherry' ?

Because it's the sweetest part of the cake.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].