Replies: 4 comments
-
It's indeed possible to use arbitrary neural network in ONNX format with Lc0, however, the format of inputs ("112 planes") and outputs (WDL or Q, and vector of policy numbers) cannot be changed without also changing the binary. ONNX is a format which most of popular NN frameworks can input into. You probably need much more details than I just wrote above. I'd recommend to join our Discord chat at http://lc0.org/chat and ask there. |
Beta Was this translation helpful? Give feedback.
-
Thank you Sasha for shading some light on the topic. I can understand 12 of the 112 planes as 8x8 null tables with "1" in correspondance of the of piece positions for each one of the twelve piece type (6 white, 6 black), but what about the others 100? And what is the format expected from the output? Since ONNX format compatibility I think was made on purpose to allow custom models, there is some documentation already somewhere? Or there is some plan to do it? Sure chat might be useful on specific contingent issue (and I took note), but for this still generic topic probably continuing here would be best for someone looking for the same in future. Thank you! |
Beta Was this translation helpful? Give feedback.
-
The 112 planes are filled here: https://github.com/LeelaChessZero/lc0/blob/master/src/neural/encoder.cc#L134 (the INPUT_CLASSICAL_112_PLANE variant). Basically, it's the same as AlphaZero original 112 planes, except instead of "second repetition" plane, we set it to 1 (for board edge detection), and we don't have "move count" plane. The Discord chat really contains lots of information and it's searchable, I don't think anyone would volunteer to re-summarize it here. Similarly, the documentation is missing but certainly would be useful, but again the project doesn't have enough hands to do that, so contributions to documenting issues would also be helpful. I understand that it's not the kind of the answer you'd like to hear, but it's what it is. |
Beta Was this translation helpful? Give feedback.
-
I tried to look at encoder.cc, is it possible that the input structure is a 9-fold repetition of the "historical" one-hot encoding 12 planes of the boards plus two additional planes for en-passat and 50 moves rule (with some exception pre-full history treating castling)? PS: If this is the case is pretty surprising to me, since how I got to a specific position (means the historical tables) does nothing to change the evaluation of the position or the best moves available. In this case seems to me that we are just overloading the network of unuseful information (while at the same time not giving any others easily calculable clues like piece mobility, square control, pinned pieces, etc.) |
Beta Was this translation helpful? Give feedback.
-
Long time ago (before AlphaZero was born) I created a framework to experiment with deep-learning applied to Chess.
The framework (written with the first Keras) allows to create and train a model. In order to "play" with it I created a very simple "1-ply" move search, and as you can imagine it is pretty bad.
Now, from what I've seen, seems that lc0 allows to use different models, but didn't find anything explaining how-to.
Is it really possible to use a generic deep learning model (in my case trained with supervised learning)? And in case, is it documented somewhere or is it possible to document it?
Beta Was this translation helpful? Give feedback.
All reactions