Skip to main content

Reinforcment Learning Environments

Project description

Reinforcement Learning Environments

This package is to simplify life for doing RL experiments by providing easily generatable RL environments that can be used to test out RL algorithms.

This is still work in progress, however, hopefully this will serve as a useful feature for exact RL experiments in a reproducible, light-weight and scientific manner.


Getting Started.

Installation

Installing with PyPi

pip3 install rlenvs

Installing from source

git clone https://github.com/ai-nikolai/rl-environments
cd rl-environments
pip3 install -e .

Examples:

Bandit

from rlenvs.bandits import MultiarmBernoulliBandit

env = MultiarmBernoulliBandit(arms=5)

reward, observation, is_finished, internal_state = env.step(0) #picks arm 0

Tree MDP

from rlenvs.mdps import BalancedDenseTreeDeterministicMDP

env = BalancedDenseTreeDeterministicMDP(branching=3, depth=5) #creates a tree with 3 choices each turn and a total of 5 turns.

reward, observation, is_finished, internal_state = env.step(3) #picks arm 0

Documentation:

Overview:

Overall, this package provides environments, whose API is quite similar to the environments provided by Deepmind and OpenAI. (for interoperability.)

That is the interface provided by every environment:

class BaseEnvironment(object):
    """
    Implements the following methods inspired by both OpenAI gym and Deepmind Bsuite (dm_env).
    :step(action) -> reward(float), observation(Optional[Any]), is_finished(bool), state(Optional[Any]):
    :reset() -> "resets the environement":
    :undo() -> "goes to the previous state of the environment" reward, observation, is_finished(bool), sate(Optional[Any]):
    :go_to_state(state) -> "goes to a specific state of the environment" is_finished(bool):
    :seed(int) -> "sets the seed":
    :render() -> "renders the environment":
    :get_specs() -> returns the custom specs of the environment:
    """

Troubleshooting / FAQs:

Requirements: (What are the requirements):

In the future this will hopefully be configurable

python >= 3.6
networkx
graphviz
...

Copyright (C) - Nikolai Rozanov 2020-Present

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

rlenvs-0.0.0.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

rlenvs-0.0.0.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file rlenvs-0.0.0.1.tar.gz.

File metadata

  • Download URL: rlenvs-0.0.0.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for rlenvs-0.0.0.1.tar.gz
Algorithm Hash digest
SHA256 8c9df3508b2a7709965dedaf370e6971dcf6217a9969d8a45a4d8bef929f8a1f
MD5 feaca3a9be43c61f93e9bc6493a9e800
BLAKE2b-256 dd5b97a1dfbe8f09b8ffdfa2a95e014d3754423a6834d456243f1018ee7099c9

See more details on using hashes here.

File details

Details for the file rlenvs-0.0.0.1-py3-none-any.whl.

File metadata

  • Download URL: rlenvs-0.0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for rlenvs-0.0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 54f9b45b39decae466cdd0f97195301a2a6830b05255f1c9d0c746bbed427b28
MD5 49dd24800545b5cffa2e5ec2f98a36bd
BLAKE2b-256 946d74e3d9b7488360b5ce2cecf2700a9bcf25fc37cf926a9c5ff21fd55230de

See more details on using hashes here.

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