Skip to main content

Reinforcement learning with pytorch

Project description

BlobRL : Reinforcement Learning library with Pytorch

Pypi Read the Docs Build Status CodeFactor Codecov Discord License

BlobRl is a modular library for reinforcement learning which works on pytorch.

Installation

Pytorch

For installing pytorch follow Quick Start Locally for your config.

BlobRL

Install blobrl

  • to use it:
pip install blobrl
  • to use it on notebook:
pip install blobrl[notebook]
  • to help development:
pip install blobrl[dev]

Get Started

Initialize environment

import gym
env = gym.make("CartPole-v1")

Initialize agent

from blobrl.agents import AgentRandom
action_space = env.action_space
observation_space = env.observation_space
agent = AgentRandom(observation_space=observation_space, action_space=action_space)

Train

Create Trainer

from blobrl import Trainer
trainer = Trainer(environment=env, agent=agent, log_dir="./logs")

Start training:

trainer.train(max_episode=100, nb_evaluation=4, render=True)

Watch metrics

Visualize training and evaluation metrics:

tensorboard --logdir logs

Environments

We will use GYM environments for moments.

Watch TODO for environments in coming.

Agents

Agent implemented:

  • AgentConstant, this agent choice one random action on start and will take her all next time
  • AgentRandom, this agent choice one random action each time
  • DQN, Deep Q Learning (Mnih et al., 2013)
  • DoubleDQN, (van Hasselt et al., 2016)
  • DuelingDQN, (Wang et al., 2016)
  • CategoricalDQN, (Bellamare et al., 2017)

Examples

You can find all examples here

Results

CartPoleExemple.gif

You can see more results and analysis

Project details


Download files

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

Source Distribution

blobrl-0.1.3.tar.gz (23.7 kB view details)

Uploaded Source

File details

Details for the file blobrl-0.1.3.tar.gz.

File metadata

  • Download URL: blobrl-0.1.3.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for blobrl-0.1.3.tar.gz
Algorithm Hash digest
SHA256 067ba1b7725140c4698744d7c7c3f6d0ae7289a25324f4258bc5107ddcb63230
MD5 ae346f6ca65f698b3210c7561ec59ad5
BLAKE2b-256 e9240dc23cf326a04ae7ddeae7c3eb112441cfb5afa1d4e1edd6542a2c89235a

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