From: Jean-loup Gailly Date: Sun, 12 Aug 2012 00:21:25 +0000 (+0200) Subject: New parameter defaults, obtained by tuning on large configurations X-Git-Tag: pachi-10.00-satsugen~9 X-Git-Url: https://repo.or.cz/w/pachi.git/commitdiff_plain/49249d551eb6caa3ba8fdde80438c509d79e8d48 New parameter defaults, obtained by tuning on large configurations Kept default debug_level=3 and pondering=0 but for optimal results use: -d 0 pondering=1 --- diff --git a/board.h b/board.h index c1586e4..e6c47d4 100644 --- a/board.h +++ b/board.h @@ -279,6 +279,7 @@ struct board { * possibly not very rewarding if you are interested just in * 9x9 and 19x19. */ #define board_large(b_) (board_size(b_)-2 >= 15) +#define board_small(b_) (board_size(b_)-2 <= 9) #if BOARD_SIZE == 19 # define board_bits2(b_) 9 diff --git a/distributed/distributed.h b/distributed/distributed.h index b7dbcf8..f90a8f4 100644 --- a/distributed/distributed.h +++ b/distributed/distributed.h @@ -78,15 +78,16 @@ struct incr_stats { * slave and for the per-slave hash table in the master. However the * same nodes are often sent so in practice 21 bits are sufficient. * Larger hash tables are not desirable because it would take too much - * time to clear them at each move in the master. */ -#define DEFAULT_STATS_HBITS 21 + * time to clear them at each move in the master. For the default + * shared_levels=1, 18 bits are enough. */ +#define DEFAULT_STATS_HBITS 18 /* If we select a cycle of at most 40ms, a slave machine can update at * most 10K different nodes per cycle. In practice the updates are * biased so we update much fewer nodes. As shorter cyle is preferable * because the stats are more fresh. The cycle time does not affect * the number of slaves and the hash table size. */ -#define DEFAULT_SHARED_NODES 1024 +#define DEFAULT_SHARED_NODES 10240 /* Maximum game length. Power of 10 jut to ease debugging. */ diff --git a/playout/moggy.c b/playout/moggy.c index c298423..64fa595 100644 --- a/playout/moggy.c +++ b/playout/moggy.c @@ -934,17 +934,16 @@ playout_moggy_init(char *arg, struct board *b, struct joseki_dict *jdict) * XXX: no 9x9 tuning has been done recently. */ int rate = board_large(b) ? 80 : 90; - pp->lcapturerate = pp->atarirate = pp->nlibrate = pp->patternrate - = pp->selfatarirate = pp->eyefillrate = pp->josekirate = -1U; - if (board_large(b)) { - pp->lcapturerate = 90; - pp->patternrate = 100; - pp->nlibrate = 20; - pp->nakaderate = 20; - pp->pattern2 = true; - } + pp->lcapturerate = pp->atarirate = pp->nlibrate + = pp->selfatarirate = pp->josekirate = -1U; + pp->patternrate = 100; + pp->nlibrate = 20; + pp->nakaderate = 20; + pp->pattern2 = true; + pp->lcapturerate = 90; pp->korate = 20; pp->koage = 4; - pp->alwaysccaprate = 20; + pp->alwaysccaprate = 40; + pp->eyefillrate = 60; pp->selfatari_other = true; pp->cap_stone_min = 2; diff --git a/uct/dynkomi.c b/uct/dynkomi.c index 4a5d666..b7d5fa0 100644 --- a/uct/dynkomi.c +++ b/uct/dynkomi.c @@ -144,10 +144,12 @@ uct_dynkomi_init_linear(struct uct *u, char *arg, struct board *b) * point of resigning immediately in high handicap games. * By move 100 white should still be behind but should have * caught up enough to avoid resigning. */ - if (board_large(b)) { - l->moves[S_BLACK] = 100; - l->moves[S_WHITE] = 50; + int moves = board_large(b) ? 100 : 50; + if (!board_small(b)) { + l->moves[S_BLACK] = moves; + l->moves[S_WHITE] = moves; } + /* The real value of one stone is twice the komi so about 15 points. * But use a lower value to avoid being too pessimistic as black * or too optimistic as white. */ diff --git a/uct/policy/ucb1amaf.c b/uct/policy/ucb1amaf.c index 9d304d3..c8630a7 100644 --- a/uct/policy/ucb1amaf.c +++ b/uct/policy/ucb1amaf.c @@ -346,7 +346,8 @@ policy_ucb1amaf_init(struct uct *u, char *arg, struct board *board) b->crit_negative = 1; b->crit_amaf = 0; - b->root_virtual_win = -1; + b->virtual_win = 5; + b->root_virtual_win = 30; b->vwin_min_playouts = 1000; if (arg) { @@ -401,8 +402,6 @@ policy_ucb1amaf_init(struct uct *u, char *arg, struct board *board) } } } - if (b->root_virtual_win < 0) - b->root_virtual_win = b->virtual_win; return p; } diff --git a/uct/uct.c b/uct/uct.c index 5a386c1..d904640 100644 --- a/uct/uct.c +++ b/uct/uct.c @@ -566,7 +566,7 @@ uct_state_init(char *arg, struct board *b) u->reportfreq = 10000; u->gamelen = MC_GAMELEN; u->resign_threshold = 0.2; - u->sure_win_threshold = 0.9; + u->sure_win_threshold = 0.95; u->mercymin = 0; u->significant_threshold = 50; u->expand_p = 8; @@ -579,7 +579,7 @@ uct_state_init(char *arg, struct board *b) u->threads = 1; u->thread_model = TM_TREEVL; - u->virtual_loss = 1; + u->virtual_loss = -1; u->fuseki_end = 20; // max time at 361*20% = 72 moves (our 36th move, still 99 to play) u->yose_start = 40; // (100-40-25)*361/100/2 = 63 moves still to play by us then @@ -587,7 +587,8 @@ uct_state_init(char *arg, struct board *b) // 2.5 is clearly too much, but seems to compensate well for overly stern time allocations. // TODO: Further tuning and experiments with better time allocation schemes. u->best2_ratio = 2.5; - u->max_maintime_ratio = 3.0; + // Higher values of max_maintime_ratio sometimes cause severe time trouble in tournaments + u->max_maintime_ratio = 1.5; u->val_scale = 0; u->val_points = 40; u->dynkomi_interval = 1000; @@ -602,6 +603,7 @@ uct_state_init(char *arg, struct board *b) u->max_slaves = -1; u->slave_index = -1; u->stats_delay = 0.01; // 10 ms + u->shared_levels = 1; u->plugins = pluginset_init(b); @@ -1157,9 +1159,12 @@ uct_state_init(char *arg, struct board *b) if (!u->shared_nodes) u->shared_nodes = DEFAULT_SHARED_NODES; assert(u->shared_levels * board_bits2(b) <= 8 * (int)sizeof(path_t)); } + if (u->virtual_loss == -1) + u->virtual_loss = u->threads >= 4 ? 4 : u->threads; if (!u->dynkomi) - u->dynkomi = uct_dynkomi_init_linear(u, NULL, b); + u->dynkomi = board_small(b) ? uct_dynkomi_init_none(u, NULL, b) + : uct_dynkomi_init_linear(u, NULL, b); /* Some things remain uninitialized for now - the opening tbook * is not loaded and the tree not set up. */