Coder Social home page Coder Social logo

gym-tictactoe's Introduction

gym-tictactoe

OpenAI Gym Style Tic-Tac-Toe Environment.

  |O|X
 -----
  |O| 
 -----
 O|X|X

O's turn.
Enter location[1-9], q for quit:

Requirement

Python >= 3.5

Install

git clone https://github.com/haje01/gym-tictactoe.git
cd gym-tictactoe/
pip install -e .

Try example agents

cd examples/
python human_agent.py
python base_agent.py
python td_agent.py

Temporal Difference Agent Commands

Learn

Usage: td_agent.py learn [OPTIONS]

  Learn and save the model.

Options:
  -p, --episode INTEGER  Episode count.  [default: 17000]
  -e, --epsilon FLOAT    Exploring factor.  [default: 0.08]
  -a, --alpha FLOAT      Step size.  [default: 0.4]
  -f, --save-file TEXT   Save model data as file name.  [default:
						 td_agent.dat]
  --help                 Show this message and exit.

Bench

Usage: td_agent.py bench [OPTIONS]

  Benchmark agent with base agent.

Options:
  -p, --episode INTEGER  Episode count.  [default: 3000]
  -f, --model-file TEXT  Model data file name.  [default: td_agent.dat]
  --help                 Show this message and exit

Grid search

Usage: td_agent.py gridsearch [OPTIONS]

  Grid search hyper-parameters.

Options:
  -q, --quality [high|mid|low]  Grid search quality.  [default: mid]
  -r, --reproduce-test INTEGER  Reproducibility test count.  [default: 3]
  --help                        Show this message and exit.

Play

Usage: td_agent.py play [OPTIONS]

  Play with human.

Options:
  -f, --load-file TEXT  Load file name.  [default: td_agent.dat]
  -n, --show-number     Show location number when play.  [default: False]
  --help                Show this message and exit.

gym-tictactoe's People

Contributors

dustinmichels avatar haje01 avatar johannkm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gym-tictactoe's Issues

'TicTacToeEnv' object has no attribute '_seed'

After running set up, I get:

>python td_agent.py play -f best_td_agent.dat
Traceback (most recent call last):
  File "td_agent.py", line 590, in <module>
    cli()
  File "D:\anaconda\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "D:\anaconda\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "D:\anaconda\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\anaconda\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:\anaconda\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "td_agent.py", line 280, in play
    _play(load_file, HumanAgent('O'), show_number)
  File "td_agent.py", line 296, in _play
    env = TicTacToeEnv(show_number=show_number)
  File "d:\git\soda-cosmos\gym\gym-tictactoe\gym_tictactoe\env.py", line 96, in __init__
    self._seed()
AttributeError: 'TicTacToeEnv' object has no attribute '_seed'

Values in best_td_agent

Hi, i was trying to develop a RL agent who can play the Tic Tac Toe game and was wondering how did you get the data in the best_td_agent.dat file. Because, it is used as the optimal policy for the your agent to follow. Did you save them after playing many episodes or is there any other methods. Your answer would be really helpful

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.