From 30573fb54ec687a34c835aeeede22c15d4b32200 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Mon, 8 Aug 2011 20:58:43 +0200 Subject: [PATCH] UCB1AMAF crit_plthres_coef: Dynamic playout threshold for node criticality --- TODO | 3 --- uct/policy/ucb1amaf.c | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 708a40b..9b35316 100644 --- a/TODO +++ b/TODO @@ -10,9 +10,6 @@ Base: General improvements: * Opening book -* Criticality - Further use in search. Experiment with crit_min_playouts adaptively - adjusting based on number of simulations so far. * Killer moves * MM local-based patterns * Balanced local-based patterns? diff --git a/uct/policy/ucb1amaf.c b/uct/policy/ucb1amaf.c index 0479cbb..a38cb0f 100644 --- a/uct/policy/ucb1amaf.c +++ b/uct/policy/ucb1amaf.c @@ -35,6 +35,7 @@ struct ucb1_policy_amaf { /* Coefficient of criticality embedded in RAVE. */ floating_t crit_rave; int crit_min_playouts; + floating_t crit_plthres_coef; bool crit_negative; bool crit_negflip; bool crit_amaf; @@ -112,7 +113,9 @@ ucb1rave_evaluate(struct uct_policy *p, struct tree *tree, struct uct_descent *d } /* Criticality heuristics. */ - if (b->crit_rave > 0 && node->u.playouts > b->crit_min_playouts) { + if (b->crit_rave > 0 && (b->crit_plthres_coef > 0 + ? node->u.playouts > tree->root->u.playouts * b->crit_plthres_coef + : node->u.playouts > b->crit_min_playouts)) { floating_t crit = tree_node_criticality(tree, node); if (b->crit_negative || crit > 0) { floating_t val = 1.0f; @@ -322,6 +325,8 @@ policy_ucb1amaf_init(struct uct *u, char *arg) b->crit_rave = atof(optval); } else if (!strcasecmp(optname, "crit_min_playouts") && optval) { b->crit_min_playouts = atoi(optval); + } else if (!strcasecmp(optname, "crit_plthres_coef") && optval) { + b->crit_plthres_coef = atof(optval); } else if (!strcasecmp(optname, "crit_negative")) { b->crit_negative = !optval || *optval == '1'; } else if (!strcasecmp(optname, "crit_negflip")) { -- 2.11.4.GIT