Skip to main content

Text Environments forked from OpenAI Gym

Project description

gym_toytext

This repository contains the text environments previously present in OpenAI Gym <0.20. These environments had been in the master branch of openai/gym but later excluded in this pull.

List of environments

environment commit history first committer
GuessingGame-v0 guessing_game.py @JKCooper2
HotterColder-v0 hotter_colder.py @JKCooper2
KellyCoinflip-v0 and KellyCoinflipGeneralized-v0 kellycoinflip.py @gwern
NChain-v0 nchain.py @machinaut
Roulette-v0 roulette.py @gdb

We also provide alternative versions of GuessingGame:

  • GuessingGame-v1 and GuessingGameRange-v1 use different default parameters.
  • GuessingGameRange-v0 and GuessingGameRange-v1 show observations in the format of (low, high).

Compatibility

  • gym>=0.26: Please use gym_toytext>=0.26.
  • gym>=0.19, gym<0.26: Please use gym_toytext==0.25.

Install

pip install gym-toytext

Usage

import gym
import gym_toytext

env = gym.make("GuessingGame-v0")
observation, info = env.reset()
low, high = env.action_space.low, env.action_space.high
while True:
    action = (low + high) / 2.
    observation, reward, termination, truncation, info = env.step(action)
    if termination or truncation:
        break
    if observation == 1:
        low = action
    elif observation == 3:
        high = action
env.close()

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

gym-toytext-0.26.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

gym_toytext-0.26.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file gym-toytext-0.26.1.tar.gz.

File metadata

  • Download URL: gym-toytext-0.26.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.11.1 requests/2.28.1 setuptools/65.6.3 requests-toolbelt/1.0.0 tqdm/4.66.4 CPython/3.11.0

File hashes

Hashes for gym-toytext-0.26.1.tar.gz
Algorithm Hash digest
SHA256 67760d87c272f59ab95497c5098c35476b607a6cc678c5bd8a3fc47b4e8ff74a
MD5 c4e78cc13466155b605b7dae3fdcc152
BLAKE2b-256 5763b816fe354c952078b973b86ca814ab8676c874383755694e513993e4daab

See more details on using hashes here.

File details

Details for the file gym_toytext-0.26.1-py3-none-any.whl.

File metadata

  • Download URL: gym_toytext-0.26.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.11.1 requests/2.28.1 setuptools/65.6.3 requests-toolbelt/1.0.0 tqdm/4.66.4 CPython/3.11.0

File hashes

Hashes for gym_toytext-0.26.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d19276b184bcd1b255135236fa8c816fb40230521aa0de6819ef7db7ffd364b5
MD5 da1ec8a8cfda015452f7b5a52be74729
BLAKE2b-256 ffb7cc3cb49525cb7e549588a3960ac3833bca357d537a90f6ba3eb9b8110678

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