pasky / pachi

A fairly strong Go/Baduk/Weiqi playing program
http://pachi.or.cz/
GNU General Public License v2.0
514 stars 117 forks source link

Dcnn pondering experiment #97

Closed lemonsqueeze closed 5 years ago

lemonsqueeze commented 5 years ago

Experiment to get dcnn pondering working on the cpu:

Tree search is heavily influenced by initial priors so we can't just reuse the tree and inject dcnn priors later on. But if we can guess opponent's next move then we can do some useful work at pondering time: evaluate dcnn and run tree search ahead of time. Later on when play command arrives we just promote the node and reuse the tree if it matches our guess. If it doesn't match we discard search results and start from scratch.

So after genmove is over, reset the tree, get dcnn priors for our move and likely opponent moves (guess from dcnn priors and genmove search results) and start pondering as usual.

This makes sense when using cpu for dcnn evaluation which is very slow, with a gpu you could evaluate dcnn for every node even during tree search so no need to go through such restrictions.

Number of guesses is controlled by 2 uct params:

For slow games it makes sense to increase this: we spend more time before actual search starts but there's more chance we guess right, so that pondering will be useful. If we guess wrong search results will be discarded and pondering will not be useful for this move. For fast games try decreasing it.