View on GitHub

Pengkun--Master-Thesis--2015

Fork of the code of Pengkun Liu's Master Thesis, June 2015

Implementation And Experimentation of Coherent Inference in Game Tree

Implementation in C++, forked from Charles-Lau-/thesis.

Usage of this program

You can either use the Makefile or the run script, or compile manually:

# Compile the program
g++ -std=c++11 -o playGame *.cpp algorithm/*.cpp
# Run it (and keep its output)
./playGame | tee -a ./playGame.log

You can have a look to the (long) playGame.log file for an example of its output.

forthebadge made-with-C++

:bug: Limitation?

The implementation is generic enough to be able to play to higher dimension Tic-Tac-Toe, not only the usual 3x3.

Example with a 4x4 Tic-Tac-Toe

When the player X has to move, it examines a few possible moves, and compute the Gaussian value function learned for each position. For instance, image that X has to play on this board state:

O O X O
_ _ _ X
O _ X X
_ X X O

Then it will explore all the possible moves (6 in our example):

V value: Gaussian N(-0.224098, 0.862775)...
O O X O
_ _ _ X
O _ X X
_ X X O

... 2 other moves

V value: Gaussian N(0.939144, 0.521763)...  <-- The best one!
O O X O
_ _ X _
O _ X X
_ X X O


V value: Gaussian N(-1.40412, 0.9321)...
O O X O
_ _ _ _
O X X X
_ X X O


V value: Gaussian N(-0.658714, 0.932628)...
O O X O
_ _ _ _
O _ X X
X X X O

Finally, the Coherent Inference algorithm will sample from each of these Gaussian distribution (associated to each children of the current node). It selects the move corresponding to the highest sample (usuall, from the more optimistic Gaussian value function V).

In the example showed above, N(0.93, 0.52) has a mean value of 0.93 (really higher than any other), so with high probability the sampling will select this action. Here it is the (only) one which directly brings X to a winning position:

O O X O
_ _ X _
O _ X X
_ X X O

This was only a very rough explanation of the algorithm. For all the details, please refer to the initial paper, or the slides or report for my project.

At the end, the coherent Gaussian inference player (X) wins 72% of the time, which for 4x4 Tic-Tac-Toe is an extremely satisfactory result! :tada:


Overview of layout of the program

Board.main() (in the code folder)

Entrance of the program:

ComputerPlayer (in the code folder)

Model a ComputerPlayer:

Ep (Expectation-Propagation) (in the algorithm folder)

Core of the expectation propagation algorithm:

Distribution (in the algorithm folder)

Node (in the algorithm folder)

Support build-up of Game tree:

Other files?


Authors

:scroll: License ? GitHub license

MIT Licensed (file LICENSE).

Maintenance Ask Me Anything ! Analytics

ForTheBadge uses-badges ForTheBadge uses-git

ForTheBadge built-with-science