From 71b8e80384e32113a7c5bb7ef3bf86ab20803e73 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Mon, 30 Jul 2012 22:52:51 +0200 Subject: [PATCH] UCT: Introduce 'maximize_score' preset that turns on adaptive dynkomi, val_scale and allow_losing_pass. --- README | 28 +++++++++++++++++++++++++++- uct/uct.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/README b/README index 9225e4f..8afda73 100644 --- a/README +++ b/README @@ -47,6 +47,8 @@ improvements have been already achieved. We rigorously play-test new features and enable them by default only when they give a universal strength boost. +How to run +~~~~~~~~~~ By default, Pachi will run on a single CPU core, taking up to 1.4GiB of memory, not pondering and taking completely arbitrary amount of time @@ -80,6 +82,31 @@ in uct/uct.c - you will find the list of UCT engine options there, each with a description. At any rate, usually the three options above are the only ones you really want to tweak. +Greedy Pachi +~~~~~~~~~~~~ + +Normally, Pachi cares only for win or loss and does not take into +account the point amount. This means that it will play slack endgame +when winning and crazy moves followed with a resign when losing. + +It may give you a more pleasurable playing experience if Pachi +_does_ take into account the point size, strives for a maximum +(reasonable) win margin when winning and minimal point loss when +losing. This is possible by using the maximize_score parameter, e.g.: + + ./pachi -t _1200 threads=8,pondering,maximize_score + +This enables an aggressive dynamic komi usage and end result margin +is included in node values aside of winrate. Pachi will also enter +scoring even when losing (normally, Pachi will never pass in that case). +Note that if you pass any 'dynkomi' parameter to Pachi, you will reset +the values set by 'maximize_score'. + +Note that Pachi in this mode may be slightly weaker, and result margin +should not be taken into account when judging either player's strength. + +Experiments and Testing +~~~~~~~~~~~~~~~~~~~~~~~ Except UCT, Pachi supports a simple idiotbot-like engine and an example treeless MonteCarlo-player. The MonteCarlo simulation ("playout") @@ -95,7 +122,6 @@ Other special engines are also provided: learned patterns * few other purely for development usage - Pachi can be used as a test opponent for development of other go-playing programs. For example, to get the "plainest UCT" player, use: diff --git a/uct/uct.c b/uct/uct.c index e29a267..a199d62 100644 --- a/uct/uct.c +++ b/uct/uct.c @@ -1053,6 +1053,40 @@ uct_state_init(char *arg, struct board *b) * replying to the genmoves command (in ms) */ u->stats_delay = 0.001 * atof(optval); + /** Presets */ + + } else if (!strcasecmp(optname, "maximize_score")) { + /* A combination of settings that will make + * Pachi try to maximize his points (instead + * of playing slack yose) or minimize his loss + * (and proceed to counting even when losing). */ + /* Please note that this preset might be + * somewhat weaker than normal Pachi, and the + * score maximization is approximate; point size + * of win/loss still should not be used to judge + * strength of Pachi or the opponent. */ + /* See README for some further notes. */ + if (!optval || atoi(optval)) { + /* Allow scoring a lost game. */ + u->allow_losing_pass = true; + /* Make Pachi keep his calm when losing + * and/or maintain winning marging. */ + /* Do not play games that are losing + * by too much. */ + /* XXX: komi_ratchet_age=40000 is necessary + * with losing_komi_ratchet, but 40000 + * is somewhat arbitrary value. */ + char dynkomi_args[] = "losing_komi_ratchet:komi_ratchet_age=60000:no_komi_at_game_end=0:max_losing_komi=30"; + u->dynkomi = uct_dynkomi_init_adaptive(u, dynkomi_args, b); + /* XXX: Values arbitrary so far. */ + /* XXX: Also, is bytemp sensible when + * combined with dynamic komi?! */ + u->val_scale = 0.01; + u->val_bytemp = true; + u->val_bytemp_min = 0.001; + u->val_byavg = true; + } + } else { fprintf(stderr, "uct: Invalid engine argument %s or missing value\n", optname); exit(1); -- 2.11.4.GIT