analyzing chess positions with lc0

1,591 views
Skip to first unread message

Hanan

unread,
Sep 25, 2018, 8:23:45 PM9/25/18
to LCZero
Hi

1. does the engine have an option to return a list of top-n moves with an associated "value", instead of just returning the best move
2. how can I run lc0 directly on a board position from the command line, i.e. without integration with a chess gui
3. is there a command line argument to control the # of nodes used
4. is there a documentation explaining the role of the various temperature  command line arguments, as well as their default values

thanks

Jupiter

unread,
Sep 25, 2018, 11:20:50 PM9/25/18
to LCZero
1. does the engine have an option to return a list of top-n moves with an associated "value", instead of just returning the best move

Use the new feature in v0.18.0-rc1 called MultiPV option

run Lco in console type

uci
isready
ucinewgame
position startpos
setoption name MultiPV value 3
go movetime 60000

That would search the best 3 moves after a search of around 1 minute. It still returns the usual bestmove, but you can see on the pv the best 3 moves.

2. how can I run lc0 directly on a board position from the command line, i.e. without integration with a chess gui

You need a fen for a position if you don't use startpos.

same as above but use your fen, type

position fen <your fen>

3. is there a command line argument to control the # of nodes used

instead of go movetime <your time> above type

go nodes <your number of nodes>  

Jupiter

unread,
Sep 26, 2018, 12:08:21 AM9/26/18
to LCZero

4. is there a documentation explaining the role of the various temperature  command line arguments, as well as their default values

Hanan

unread,
Oct 7, 2018, 4:16:22 PM10/7/18
to LCZero
thanks for your replies

I was not able to find info on the temperature command line arguments:
       --temperature=0..100           Initial temperature.
                                      (default: 0  min: 0  max: 100)
       --temp-visit-offset=-1..1e+03  Temperature visit offset.
                                      (default: 0  min: -1  max: 1e+03)
       --tempdecay-moves=0..100       Moves with temperature decay.
                                      (default: 0  min: 0  max: 100)
       --policy-softmax-temp=0.1..10  Policy softmax temperature.
                                      (default: 2.2  min: 0.1  max: 10)
the original deepmind pape only mentions a single temperature parameter used for scaling of the "visit count"

additionally, I've noticed the Dirichlet noise is disabled by default:
  -n,  --[no-]noise                   Add Dirichlet noise at root node.
                                      (default: false)
this seems different than th alphazero paper. if so, why is that so?


בתאריך יום רביעי, 26 בספטמבר 2018 בשעה 07:08:21 UTC+3, מאת Jupiter:

Dietrich Kappe

unread,
Oct 7, 2018, 4:47:56 PM10/7/18
to LCZero
I found the multipv to return some less than useful results, especially when the best move squeezes out the others. I have a feature in my bender fork that selects 1/16th random root nodes and 3/16th random nodes proportional to Q. This gives much better results and may in fact play better than vanilla lc0.

https://github.com/dkappe/lc0/tree/bender
https://github.com/dkappe/leela-chess-weights/wiki/Bender

Jon Mike

unread,
Oct 7, 2018, 7:36:50 PM10/7/18
to LCZero
Dietrich, I always like your experimental builds and this one sounds very interesting as well.  Thanks again!

Hanan

unread,
Oct 8, 2018, 6:05:17 AM10/8/18
to LCZero
please explain the multipv parameter.
I understand that it has to do with "pv" (=principal variation) heuristic used to select string nodesto improve the alpha-beta pruning.
I am looking for the top move candidates after the search completes. is that what the multipv returns? if so, could you outline the process
thanks


בתאריך יום ראשון, 7 באוקטובר 2018 בשעה 23:47:56 UTC+3, מאת Dietrich Kappe:
Message has been deleted
Message has been deleted

Dietrich Kappe

unread,
Oct 8, 2018, 10:24:33 AM10/8/18
to LCZero
Well, in the case of ab engines, pv is used for the main line, but because of ab cutoff, the information for the other moves can be useless if you want to know what the “best” variation is for each move from the root position. That’s why most ab engines do a complete search for each of these move for multipv mode.

Leela ranks its moves by visit. But if one move is particularly strong, it may have all the visits (say 200,000 vs 20). The multipv output for the move with 20 visits won’t be particularly useful. That’s the idea behind my mod, every root move gets more visits and the ones with higher Q get even more. I usually set cpuct to 5 for optimal multipv results.

Jupiter

unread,
Oct 8, 2018, 3:42:33 PM10/8/18
to LCZero
Check the source code, there is description about temperature.

Dietrich Kappe

unread,
Oct 8, 2018, 4:52:25 PM10/8/18
to LCZero
Jupiter:

Not sure if this post was for my benefit, but i’ll assume it is.

Temperature relates to selection of a move once the search is done. The rand root mod relates to the selection of a root node during the the exploration/expansion iterations of the mcts. Two totally different things.

Jupiter

unread,
Oct 9, 2018, 11:35:57 PM10/9/18
to LCZero
Thanks.
Also saw a series on lessons from A0 from Medium, temperature is mentioned here https://medium.com/oracledevs/lessons-from-alphazero-part-3-parameter-tweaking-4dceb78ed1e5
Reply all
Reply to author
Forward
0 new messages