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 hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page