All Projects → EricSteinberger → Neural-Fictitous-Self-Play

EricSteinberger / Neural-Fictitous-Self-Play

Licence: MIT License
Scalable Implementation of Neural Fictitous Self-Play

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Neural-Fictitous-Self-Play

Fruit-API
A Universal Deep Reinforcement Learning Framework
Stars: ✭ 61 (+17.31%)
Mutual labels:  games, reinforcement-learning-algorithms
Java-Questions-and-Solutions
This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
Stars: ✭ 34 (-34.62%)
Mutual labels:  game-theory
Chrome-Dino-Runner
🐱‍🐉 A Replica of the hidden Dinosaur Game from Chrome Browser Offline mode build using Python and PyGame.
Stars: ✭ 22 (-57.69%)
Mutual labels:  games
awesome-game-design
A comprehensive list of Game Design related learning materials, examples and tools.
Stars: ✭ 43 (-17.31%)
Mutual labels:  games
marcizhu
An interactive chess game in a README file!
Stars: ✭ 37 (-28.85%)
Mutual labels:  games
Roguelike
A text based Rogue Like game I made to teach myself Ruby.
Stars: ✭ 19 (-63.46%)
Mutual labels:  games
Entitas-Java
Entity Component System (ECS) in Java 8
Stars: ✭ 37 (-28.85%)
Mutual labels:  games
lightsout
🎲 Lights Out Game
Stars: ✭ 23 (-55.77%)
Mutual labels:  games
xcloud-shield
Xcloud Beta Unofficial App for the Nvidia Shield Android TV. Playing Xbox Cloud Gaming directly on the box Nvidia Shield tv in the best way.
Stars: ✭ 93 (+78.85%)
Mutual labels:  games
GameDesign11
A project based intro to game development using the Unity game engine
Stars: ✭ 26 (-50%)
Mutual labels:  games
megaverse
High-throughput simulation platform for Artificial Intelligence reseach
Stars: ✭ 148 (+184.62%)
Mutual labels:  games
FCEUX-Lua-Script-Collection
Lua scripts for FCEUX (an NES emulator). Multiple games including River City Ransom, Battle Kid
Stars: ✭ 20 (-61.54%)
Mutual labels:  games
gtsa
Game Tree Search Algorithms - C++ library for AI bot programming
Stars: ✭ 68 (+30.77%)
Mutual labels:  game-theory
stadium
A graphical interface for reinforcement learning and gym-based environments. Integrates tensorboard and various configuration utilities for ease of usage.
Stars: ✭ 26 (-50%)
Mutual labels:  gym-environment
CovGT-3DRegistration-matlab
A 3D Scene Registration Method via Covariance Descriptors and an Evolutionary Stable Strategy Game Theory Solver
Stars: ✭ 20 (-61.54%)
Mutual labels:  game-theory
GameExtractor
Reads and writes thousands of different archive and image formats used in games.
Stars: ✭ 25 (-51.92%)
Mutual labels:  games
Recurrent-Deep-Q-Learning
Solving POMDP using Recurrent networks
Stars: ✭ 52 (+0%)
Mutual labels:  reinforcement-learning-algorithms
ForzaHorizonFix
A simple fix for Forza Horizon 4 and Forza Horizon 5 crashes
Stars: ✭ 20 (-61.54%)
Mutual labels:  games
GetFreeGames
Python script to search and find free games using Steam's API and to claim them using ASF's IPC API.
Stars: ✭ 18 (-65.38%)
Mutual labels:  games
reinforced-race
A model car learns driving along a track using reinforcement learning
Stars: ✭ 37 (-28.85%)
Mutual labels:  reinforcement-learning-algorithms

Neural Fictitious Self-Play

An implementation of Neural Fictitous Self-Play [1] in the PokerRL framework.

This codebase is designed for:

  • Researchers to compare new methods to the NFSP baseline.
  • Anyone wanting to learn about Deep RL in imperfect information games.

Reproducing Results from the NFSP paper [1]

The run-script NFSP/example_paper.py launches NFSP in Leduc Hold'em with the same hyperparameters (but using 3-layer networks) as the original paper [1]. In the run shown, the 100 mA/g (= 0.1A/g from the paper) line is crossed after 230k iterations (4:24hrs) and the 60 mA/g line after 850k iterations (19hrs). We trained on a single m5.xlarge instance. To reproduce, simply run NFSP/example_paper.py. NFSP_Leduc

NFSP on your Local Machine

Install locally

First, please install Docker and download the PyCrayon container. For dependency management I recommend Miniconda. To install the dependencies, simply activate your conda environment and then run

conda install pytorch=0.4.1 -c pytorch -y
pip install PokerRL

Running experiments locally

Before starting NFSP, please spin up the log server by

docker run -d -p 8888:8888 -p 8889:8889 --name crayon alband/crayon
docker start crayon

You can now view logs at localhost:8888 in your browser. To run NFSP with custom hyperparameters in any Poker game supported by PokerRL, build a script similar to NFSP/example_paper.py. Run-scripts define the hyperparameters, the game to be played, and the evaluation metrics. Here is a very minimalistic example:

from TrainingProfile import TrainingProfile
from workers.driver.Driver import Driver
from PokerRL import BigLeduc  # or any other game

if __name__ == '__main__':
    ctrl = Driver(    
        t_prof=TrainingProfile(
                name="NFSP_TEST",                                    
                game_cls=BigLeduc,  # -- The game to play       
                lr_br=0.1, # -- Some Hyperparameters
                lr_avg=0.005,
                mini_batch_size_br=128,
                mini_batch_size_avg=128,
            ),
                
        eval_methods={ 
            "br": 2000, # Evaluate Best Response every 2000 iterations
        },
    )

    ctrl.run()

Cloud & Clusters

For deployment on AWS, whether single-core, many-core distributed, or on a cluster, please first follow the tutorial in the corresponding section of PokerRL's README.

We recommend forking this repository so you can write your own scripts but still have remote access through git. In your run-script set either the DISTRIBUTED or the CLUSTER option of the TrainingProfile to True (see e.g. NFSP/example_distributed.py). Moreover, you should specify the number of LearnerActor and evaluator workers (if applicable) you want to deploy. Note that hyperparmeters ending with "_per_la" (e.g. the batch size) are effectively multiplied by the number of workers.

When running in DISTRIBUTED mode (i.e. one machine, many cores), simply ssh onto your AWS instance, get your code onto it (e.g. through git cloning your forked repo) and start your run-script. To fire up a cluster, define a .yaml cluster configuration that properly sets up your workers. Each of them should have a copy of your forked repo as well as all dependencies on it. Use ray up ... in an ssh session to the head of the cluster to start the job - more detailed instructions about the underlying framework we use for distributed computing can be found at ray.

Citing

If you use this repository in your research, you can cite it by citing PokerRL as follows:

@misc{steinberger2019pokerrl,
    author = {Eric Steinberger},
    title = {PokerRL},
    year = {2019},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/TinkeringCode/PokerRL}},
}

Authors

  • Eric Steinberger

License

This project is licensed under the MIT License - see the LICENSE file for details.

References

[1] Heinrich, Johannes, and David Silver. "Deep reinforcement learning from self-play in imperfect-information games." arXiv preprint arXiv:1603.01121 (2016).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].