Tencent / PhoenixGo

Go AI program which implements the AlphaGo Zero paper
Other
2.88k stars 577 forks source link

[Feature Request 4] Add min and max move threshold for dirichlet noise #91

Open wonderingabout opened 5 years ago

wonderingabout commented 5 years ago

so,

one person interested in PhoenixGo asked me if it is possible to add an option to have noise only for the first moves, because it is boring to play always the same opening in the games

for example, this :

enable_dirichlet_noise: 1
dirichlet_noise_alpha: 0.03
dirichlet_noise_ratio:  0.25
dirichlet_noise_min_threshold: 0
dirichlet_noise_max_threshold: 40

would add noise only at the first 40 moves @wodesuck

i am sure that other people are interested in this

big thanks as always @wodesuck

wonderingabout commented 5 years ago

to do that, the general idea i think is to use a few if and elses :

something like this :

if (current_move < min_threshold && current_move > max_threshold) { enable_dirichlet_noise = 1; } else { enable_dirichlet_noise = 0; }

then we add a check at the begining of every move :+1: just an example of idea, i am sure that you know much better ways to do this @wodesuck

also, to do that, we would need to update all the existing config files, but i can do that in a PR if you want @wodesuck , i would be happy to help :1st_place_medal:

if we want to apply noise max threshold for all the game, then we can use max_threshold: 999 (all games are shorter than 999 moves)

wodesuck commented 5 years ago

To do this, I think you may change the config file on-the-fly, since mcts_main would reload the config every step if it had been modified. That will be more flexible than adding an option.

wonderingabout commented 5 years ago

if the config file is reloaded at every move, then we can add a line in the config file rather, ok :+1:

what do i need to add in the config file to do that @wodesuck

can you write me all the code needed for min+max dirichlet noise threshold in config file ?

big thanks :+1: