From a4900be8904e6c94395b306c7369617f352cbe00 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 23 Sep 2009 14:29:07 +0200 Subject: [PATCH] UCB1: Do not hack around pass in descend, instead give it a fixed prior of 0/10 --- uct/policy/ucb1.c | 5 +++++ uct/policy/ucb1amaf.c | 11 ++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/uct/policy/ucb1.c b/uct/policy/ucb1.c index 710a56d..189a7cf 100644 --- a/uct/policy/ucb1.c +++ b/uct/policy/ucb1.c @@ -98,6 +98,11 @@ ucb1_prior(struct uct_policy *p, struct tree *tree, struct tree_node *node, stru /* Initialization of UCT values based on prior knowledge */ struct ucb1_policy *pp = p->data; + if (is_pass(node->coord)) { + node->prior.playouts += 0; + node->prior.wins += 10; + } + /* Q_{even} */ /* This may be dubious for normal UCB1 but is essential for * reading stability of RAVE, it appears. */ diff --git a/uct/policy/ucb1amaf.c b/uct/policy/ucb1amaf.c index eb4f0e0..f9e6974 100644 --- a/uct/policy/ucb1amaf.c +++ b/uct/policy/ucb1amaf.c @@ -270,17 +270,10 @@ ucb1srave_descend(struct uct_policy *p, struct tree *tree, struct tree_node *nod if (b->urg_randomm) urgency *= (float)(fast_random(b->urg_randomm) + 5) / b->urg_randomm; - if (urgency > best_urgency) { + if (urgency > best_urgency) best_urgency = urgency; nbests = 0; - } - if (urgency >= best_urgency) { - /* We want to always choose something else than a pass - * in case of a tie. pass causes degenerative behaviour. */ - if (nbests == 1 && is_pass(nbest[0]->coord)) { - nbests--; - } + if (urgency >= best_urgency) nbest[nbests++] = ni; - } } #if 0 struct board bb; bb.size = 11; -- 2.11.4.GIT