Giter VIP home page Giter VIP logo

gym_nastics's Introduction

gym_nastics

a collection of environments for the OpenAI Gym

current environments:

  • Blackjack-v0

all the environments are registered with the gym when you import gymn_nastics

Installation

This is not in pip/pypi yet. Sorry. The easiest way will be to add a subdirectory into your project called gym_nastics by downloading the zip here and extracting it or adding a git submodule.

Environments

Blackjack-v0

  • currently a single, freshly shuffled 52 card deck is used each episode/game
  • supports actions Hit (0) and Stand (1)
  • observation is Tuple(Discrete(11),Discrete(11))
  • you only get a reward when done==True
  • your reward will be the score of your hand if you beat the dealer and didn't bust
  • the players opening hand will never be a blackjack, those hands require no decisions
  • Splitting and Betting are not supported (yet?)

in some trial runs a version of cem.py scored a 100 episode mean of 10.05 (after episode #639,900)

from __future__ import print_function
import gym
import gym_nastics
# environments are registered upon import

# Support python 2 and 3
try: range = xrange
except NameError: pass

env = gym.make('Blackjack-v0')
for i_episode in range(20):
    observation = env.reset()
    env.render()
    for t in range(100):
        action = env.action_space.sample()
        observation, reward, done, info = env.step(action)
        env.render()
        if done:
            print("Episode finished after {} timesteps\n".format(t + 1))
            break

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.