Last active
December 1, 2019 17:46
-
-
Save davidADSP/65da60a8c5d006239e0857a5089db0fe to your computer and use it in GitHub Desktop.
add_exploration_noise (https://arxiv.org/src/1911.08265v1/anc/pseudocode.py)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# At the start of each search, we add dirichlet noise to the prior of the root | |
# to encourage the search to explore new actions. | |
def add_exploration_noise(config: MuZeroConfig, node: Node): | |
actions = list(node.children.keys()) | |
noise = numpy.random.dirichlet([config.root_dirichlet_alpha] * len(actions)) | |
frac = config.root_exploration_fraction | |
for a, n in zip(actions, noise): | |
node.children[a].prior = node.children[a].prior * (1 - frac) + n * frac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment