GithubHelp home page GithubHelp logo

cs238_final_project's Introduction

cs238_final_project (DeepGo.py)

An attempt at replicating AlphaGo by DeepMind.

Files

Roc_.py files

Taken from the Rochester-NRT/RocAlphaGo project.


DataGen.py

Implements the data generation functionalities for RL and Value iteration stages.

Functions RL_Playout(numGames, policyModel, filename=None, opponentModel) and Value_Playout(numGames, sl_model, rl_model, filename, U_MAX) wraps around those functions numGames times and stores the result to an .hdf5 file specified via filename.

Functions Gym_DataGen(policyModel), RL_DataGen(policyModel, opponentModel), and valueDataGen(sl_model, rl_model, U_MAX) implements 1 pass through of a simulation, and returns appropriate data for that simulation.

.hdf5 file contents for each functions are as follows: *RL_Playout() - 'states' 'actions' 'rewards' (actions not 1-hot encoded) *Value_Playout() - 'states' 'rewards'


NNGoPlayer.py

Implements the Go player class.

Important Fields:

  • self.states - A list of all states encountered while playing
  • self.actions - A list of all actions made
  • self.nnmodel - NN backend that makes the decision
  • self.color - NNGoPlayer.BLACK or NNGoPlayer.WHITE
  • self.rocColor - Rocgo.BLACK or Rocgo.WHITE
  • self.pachiColor - pachi_py.BLACK or pachi_py.WHITE

Important Functions:

  • makemoveGym()
  • makemoveRL(playRandom)
  • makeRandomValidMove()

nn_vs_nnGame(rocEnv, playBlack, nnBlack, nnWhite) is also implemented, and it plays out a game between two NNGoPlayer classes starting at the board configuration specified in rocEnv


utils.py

Implements I/O related functions.

Useful Functions:

  • write2hdf5(filename, dict2store)
  • hdf52dict(hdf5Filename)
  • hdf5Augment(filename, outfilename)
  • pachiGameRecorder(filename)

rochesterWrappers.py

Wrapper functions for the Rochester Go Board implementations.

Useful Functions:

  • initRocBoard()
  • rocBoard2State(rocEnv)
  • printRocBoard(rocEnv)
  • returnRocBoard(rocEnv)
  • get_legal_coords(rocEnv)
  • intMove2rocMove(rocEnv)

MCTS.py

A Monte-Carlo Tree Search implementation. Class MCNode represents a node in a tree. MCTreeSearch() can be called to initiate the search.

cs238_final_project's People

Contributors

nipunagarwala avatar yinoue93 avatar

Watchers

 avatar

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.