Comments (5)
I've implemented PackedSfenValue
format in c-chess-cli, to generate the training data. You might find this interesting.
It's engine agnostic, and can be used to sample game in any tournament condition you would otherwise run (same as cutechess-cli), not baked into Stockfish. You can specify sample frequency, and PV resolution (resolve tactics and record only non-check PV leave position).
What I'm missing are:
- unit tests: a few
PackedSfenValue
records with their binary representation to validate the code. sfMove
andply
(currently exported as zero).
from nnue-pytorch.
That's cool!
One issue that I see is that we were using stockfish internal units for score, which inadvertedly means any generalization will break that, as cp is the only widely agreed format. I think it's good to try slowly move towards a more standardized representation, but it should be visibly documented for now :)
from nnue-pytorch.
Since I want to be engine agnostic, I am using:
- cp for non mate scores: this is natural, and corresponds to what the UI reads when parsing
info ... score %d
lines. INT16_MAX - X
: for mate inX
moves.INT16_MIN + Y
: for mated inY
moves.
The only thing that all engines seem to agree on is that int16_t
is enough. Mate score, however, is where they all disagree. I think SF uses 32000-2*X+1
and -32000+2*Y
, so there would some translation there (or perhaps you would just discard mate positions as they are not really useful for training).
from nnue-pytorch.
While writing the code, I couldn't help but notice
- castling encoding is not Chess960 compatible, and that's easy to fix. if you take the castling rooks (of both colors), you will notice that they occupy at most 2 files. so you just need 2*3 extra bits to encode those files. which gives you 228+6=234, still well below 256 bits.
- if changing the format is possible (is it?), you may as well correct the way rule50 and fullMove are encoded, just 7 bits for rule50 and 16 for fullMove, the way it was meant to be (instead of the clumsy lower part followed by upper part that is currently implemented).
from nnue-pytorch.
- I think it should be just possible to mark correct castling rights in the .bin format. Whether it's castling in normal chess or chess960 can be resolved based on the parser state. If you feel like trying to implement it in a backward compatibile way feel free, I don't really care about chess960 personally.
- The current implementation is the only backward compatibile fix that was possible to the issue of having only 6 bits for rule50 initially, see https://github.com/nodchip/Stockfish/pull/182/files
from nnue-pytorch.
Related Issues (20)
- Creating new training data files for new training objective HOT 1
- serialize with --features=HalfKP no longer works
- Wrong input size in SFNNv5 architecture diagram
- Pytorch Lightning Version
- Illegal instruction HOT 2
- serialize.py not working HOT 9
- Changing epoch size and resulting number of epochs when running train.py HOT 3
- Error with visualize.py HOT 2
- Loss Curves HOT 6
- Testing trained model HOT 7
- Is it possible to convert a NNUE file (weights and biases) to emulate an older version? HOT 3
- Butterfly Effect Can Cause The Wrong NNUE Evaluation HOT 7
- Stockfish 15.1 NNUE Eval Blunder Due To The Butterfly Effect
- train.py stops without errors HOT 1
- No .nnue files found HOT 4
- Network Testing Issue HOT 2
- pytorch alphazero? HOT 1
- ftperm.py crashes with 'FenBatchProvider' object has no attribute 'stream'
- Visualizing chess position embeddings HOT 7
- Quantization losses in the L1 biases of L1 3072
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nnue-pytorch.