Giter VIP home page Giter VIP logo

cfrplusmatrix's Introduction

CFRPlusMatrix

Solves random zero-sum matrix games using Fictitious play, Counterfactual Regret Minimization and CFR+.

#####Building

make

#####Parameters

  • -h show help
  • -a <id> algorithm
    • -a 0 Fictitious play
    • -a 1 CFR
    • -a 2 CFR+ (default)
  • -s <n> matrix dimensions (n-by-n) (default 1000)
  • -distribution <id> random number distribution
    • -distribution 0 uniform [-1, 1] (default)
    • -distribution 1 normal (sigma 0.5)
    • -distribution 2 cauchy (gamma 0.02)
  • -e <epsilon> epsilon (default 0.0001)
  • -n <n> number of times to run
  • -all run all algorithms (used together with -n)
  • -dump print payoffs and strategies when done
  • -delay <n> CFR+ averaging delay in number of iterations (default 0)
  • -w <id> CFR+ weighting mode
    • -w 0 constant (like in CFR)
    • -w 1 linear (default)
    • -w 2 quadratic (often faster than linear but can get stuck in small games)

#####Examples

./CFRPlusMatrix -a 0 -s 10 -e 0.001

Use algorithm 0 (Fictitious play) to find an epsilon-equilibrium with epsilon of 0.001 in a 10x10 game.

./CFRPlusMatrix -a 1 -s 100 -e 0.0001

Use algorithm 1 (CFR) to find an epsilon-equilibrium with epsilon of 0.0001 in a 100x100 game.

./CFRPlusMatrix -a 2 -s 1000 -e 0.00001

Use algorithm 2 (CFR+) to find an epsilon-equilibrium with epsilon of 0.00001 in a 1000x1000 game.

./CFRPlusMatrix -s 10 -e 0.0001 -n 50 -all

Compare algorithms. It will output something like this:

Matrix size: 10x10
Epsilon: 0.000100
N: 50
Fictitious play  | min 9500 | max 1690341 | avg 597456.7
CFR              | min 3483 | max 49694  | avg 17850.9
CFR+             | min 127  | max 3657   | avg 968.6

See http://jeskola.net/cfr/ for more stuff.

cfrplusmatrix's People

Contributors

skario avatar

Watchers

James Cloos avatar Aaron Ma 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.