Skip to main content

Pytorch version of Stable Baselines, implementations of reinforcement learning algorithms.

Project description

Stable Baselines3

Stable Baselines3 is a set of improved implementations of reinforcement learning algorithms in PyTorch. It is the next major version of Stable Baselines.

These algorithms will make it easier for the research community and industry to replicate, refine, and identify new ideas, and will create good baselines to build projects on top of. We expect these tools will be used as a base around which new ideas can be added, and as a tool for comparing a new approach against existing ones. We also hope that the simplicity of these tools will allow beginners to experiment with a more advanced toolset, without being buried in implementation details.

Links

Repository: https://github.com/DLR-RM/stable-baselines3

Medium article: https://medium.com/@araffin/df87c4b2fc82

Documentation: https://stable-baselines3.readthedocs.io/en/master/

RL Baselines3 Zoo: https://github.com/DLR-RM/rl-baselines3-zoo

Quick example

Most of the library tries to follow a sklearn-like syntax for the Reinforcement Learning algorithms using Gym.

Here is a quick example of how to train and run PPO on a cartpole environment:

import gym

from stable_baselines3 import PPO

env = gym.make('CartPole-v1')

model = PPO('MlpPolicy', env, verbose=1)
model.learn(total_timesteps=10000)

obs = env.reset()
for i in range(1000):
    action, _states = model.predict(obs, deterministic=True)
    obs, reward, done, info = env.step(action)
    env.render()
    if done:
        obs = env.reset()

Or just train a model with a one liner if the environment is registered in Gym and if the policy is registered:

from stable_baselines3 import PPO

model = PPO('MlpPolicy', 'CartPole-v1').learn(10000)

Project details


Release history Release notifications | RSS feed

This version

0.6.0

Download files

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

Source Distribution

stable_baselines3-0.6.0.tar.gz (85.8 kB view details)

Uploaded Source

Built Distribution

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

stable_baselines3-0.6.0-py3-none-any.whl (105.6 kB view details)

Uploaded Python 3

File details

Details for the file stable_baselines3-0.6.0.tar.gz.

File metadata

  • Download URL: stable_baselines3-0.6.0.tar.gz
  • Upload date:
  • Size: 85.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for stable_baselines3-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b5bd7165bf8cd654d43dad11348ea1c650ecedf3ddcaeb545bd92fa05b05d77f
MD5 55a1856665a487ed4c9911d1b4bcda80
BLAKE2b-256 2d9be4d0f7750e5a01e160322765ed083018608ec318cf840eeff5e4e884206c

See more details on using hashes here.

File details

Details for the file stable_baselines3-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: stable_baselines3-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 105.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for stable_baselines3-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1902b44dcc77a1e50af4f1c692ebf6a8c1a41515872b1f9b7b7ea66fc45d4d9
MD5 079e8b8bf6ac59b81e4ff3c9ded1dec5
BLAKE2b-256 1977b004f732e451bea24a515e1a23913b36afd0c3e7e2a716d768ea61699b55

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