Pruning neural net available for GNU Backgammon
At last! The smaller pruning neural net for GNU Backgammon is released for the main project of GNU Backgammon.
This is good news for all of you!
As maybe some of you know, one of GNU Backgammons developers, Joseph Heled, has developed some additional neural nets to GNU Backgammon. These smaller nets is used to prune away bad candidates moves before it moves on to the big neural net. This has been known as a huge evaluations speed improvement.
Unfortunately this use of the smaller pruning neural nets has only been available for those who use the fibs2html, sagnubg and gnubg-nn. (These are small tools for offline analysis, network training and scripting.) It was developed several years ago. The development of this and the main project has deverged so much over that time so merging this into the main trunk of the project has therefore been a hard job. This is therefore also really good news that this improvement is now available for the main program of GNU Backgammon.
How it works
Imagine a position where you have many move options. Specially in positions where you roll doubles there are many opportunities and many legal moves. Imagine this position:
Imagine how many ways it is to play 11 in this position? Don't even bother counting. It's a lot! Every position after a legal move must
be evaluated. One evaluation takes about 0.05 ms (milliseconds) through the evaluator on a modern 2GHz computer. But in this position a lot of moves are just silly. Think about a move like 8/7 6/5 6/4. Only the biggest backgame player would even consider that, and it's surely inferior. It's so bad it's not even worth spending 0.05 ms on this play. You may say that 0.05 ms isn't much time, but think about how many silly legal moves this position have and then muliply. Consider also that you may be analysing a whole match with many games and many moves, with many move alternatives. If you multiply all this, you will find out that a lot of time is spent evaluating silly moves.
One might think that pruning is done at the top level, i.e that some moves are filtered away and never evaluated by the main nets. This is not correct - it is the job of the move filters, which I think do it in a good and flexible manner. So every move is considered by at least 0-ply. We get away with that because 0-ply is so strong. The pruning net comes to play in higher plies (1-ply, 2-ply etc.), where it helps when choosing a move inside a higher ply evaluation
. As you all know, even thou a 2-ply is composed of only
441 evaluations, one has to do between 4000 to 5000 evaluations on average (after taking advantage of caching) to get that result.
The smaller pruning neural nets is much much faster to evaluate a position. Since the net is so much faster it will speed up the whole evaluation. The normal net makes about 32000 multiplications on one evaluation while the smaller pruning neural uses about 1300 multiplications for it's evaluation. The smaller net will therefore evaluate a position about 25 times faster than the normal neural net.
The smaller nets are therefore really fast compared to the ordinary nets, but this is of course at the cost of accuracy. The smaller neural nets are not as good as the normal neural nets. The smaller neural nets are therefore just to prune away all those silly moves before it sends the candidate moves to the normal neural net evaluators. Overall this makes a major improvment to the overall evaluation speed.
My congratulations and big thanks to all who contributed to this great improvement in GNU BG.
Actually, before adding this new code, each time I tried playing against GNU BG in tutor mode, I got quickly discouraged by the slow pace of playing, as, like most BG players, I like fast playing.
Now it seems that I can play at my normal play speed, with tutor mode on !! So that's really good news !
Again, thanks to all for your efforts to make GNU Backgammon a great way of improving our BG skills.
This looks promising, thanks!
I wonder if you could elaborate a bit on how this small and quick pruning net is actually being used?
Does it work for all n-ply analyses/evaluations? Will it prune away when looking ahead as well, that is, when deciding on future moves?
Zorba: I have just added a paragraph to the text which is based on the message from Joseph. Maybe it helps.
Hi, I did a analysis with the new pruning build, but I got this confusing result:
I also can't understand the match statistics they look the same way
2-ply cubeless equity +0,282 (Money: +0,438)
0,641 0,285 0,012 - 0,359 0,136 0,004
1. No double -1,#IO
2. Double, take -1,#IO ( -1,#IO)
3. Double, pass -1,#IO ( -1,#IO)
Proper cube action: Too good to double, pass
Congratulations to this new improvement!
Have you considered to use the pruning net as evaluation engine for variance reduction on 0-ply rollouts? Right now I don't use VR on those because it's so expensive relative to the rollout itself. If the pruning net is good enough, that might be much more effective.
Can Any one tell me where I can find the weights files ???
I can see from the screenshots that this looks like a new version of GNUBG. I will certainly try it out.
All I can say is that I hope this version 'actually' has 'random dice'. (or an option for manual!)
I have played 0.14.3 so many times that I can write down what the roll will be for both sides and be right 90% of the time.....