AutoReviewUsingGnugo

  Difficulty: Intermediate   Keywords: Software

http://img215.imageshack.us/img215/4870/gnugoreview.png?alignright.jpg

GnuGo can be used to help review your game. The essence of the procedure is to get every board positions evaluated and the outcome estimated by GnuGo then you can check the trends of the result. Below you can find description of a way you can achieve this. The described solution requires some tools namely Perl, GnuGo and [ext] GnuPlot, but the procedure can be done using other tools.

First install the prerequisites according to your operating system. For example on Ubuntu Linux use the following terminal command:

sudo apt-get install gnugo gnuplot perl

On Windows you have to download and install the tools separately. After installation copy the code below the horizontal line incorporates the evaluation procedure to a text editor and save it as sgf_diagram. Run it with the following command:

perl sgf_diagram myGameToReview.sgf

where replace myGameToReview.sgf to the SGF file you want to review. Since evaluating a position takes some time for GnuGo, the processing of the file can last a few minutes. After the evaluation done the script shows the results in a diagram using GnuPlot?.

In the diagram you can see two curves. The green one is the actual estimated outcome of the game at every move. For good play, the estimated points wouldn't vary a lot, but for weaker players the result will oscillate. The amplitude shows the rate of the deviation from the perfect play. The red curve is the filtered results where the trend of the game can be checked easier.


if ($ARGV[0] eq '') { print "usage\n  sgf_diagram <sgffile>\n"; }
open OUT, '>sgf_diagram.csv';
for (1..400)
{
 $out = `gnugo --score estimate -l $ARGV[0] -L $_`;
 $out =~ /(\d+.\d+)/;
 $res = $1;
 if ($out =~ /white/i) { $res = -1 * $res; }
 $filt = ($prev + $res)/2;
 $prev = $res;
 print "$_\t$filt\t$res\n";
 print OUT "$_\t$filt\t$res\n";
}
close OUT;
open GPLT, '|gnuplot -persist';
print GPLT 'set ylabel "black points - white points"';
print GPLT 'set xlabel "moves"';
print GPLT 'plot "sgf_diagram.csv" u 1:3 w l lc 2 t "", "sgf_diagram.csv" u 1:2 w l lc 1 t ""';

AutoReviewUsingGnugo last edited by VanMorrison on August 28, 2018 - 13:30
RecentChanges · StartingPoints · About
Edit page ·Search · Related · Page info · Latest diff
[Welcome to Sensei's Library!]
RecentChanges
StartingPoints
About
RandomPage
Search position
Page history
Latest page diff
Partner sites:
Go Teaching Ladder
Goproblems.com
Login / Prefs
Tools
Sensei's Library