]> git.sesse.net Git - stockfish/commit - src/nnue/layers/input_slice.h
Exporting the currently loaded network file
authorTomasz Sobczyk <tomasz.sobczyk1997@gmail.com>
Fri, 7 May 2021 10:24:12 +0000 (12:24 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 11 May 2021 17:36:11 +0000 (19:36 +0200)
commit58054fd0fa6294510fc8cf76b0ba9673d5094c10
tree397ccd66bcb7b680ab96b006787cd1ff2c3245ea
parentd777ea79fff0f651bd948c881946cd06bebd9381
Exporting the currently loaded network file

This PR adds an ability to export any currently loaded network.
The export_net command now takes an optional filename parameter.
If the loaded net is not the embedded net the filename parameter is required.

Two changes were required to support this:

* the "architecture" string, which is really just a some kind of description in the net, is now saved into netDescription on load and correctly saved on export.
* the AffineTransform scrambles weights for some architectures and sparsifies them, such that retrieving the index is hard. This is solved by having a temporary scrambled<->unscrambled index lookup table when loading the network, and the actual index is saved for each individual weight that makes it to canSaturate16. This increases the size of the canSaturate16 entries by 6 bytes.

closes https://github.com/official-stockfish/Stockfish/pull/3456

No functional change
README.md
src/evaluate.cpp
src/evaluate.h
src/nnue/evaluate_nnue.cpp
src/nnue/layers/affine_transform.h
src/nnue/layers/clipped_relu.h
src/nnue/layers/input_slice.h
src/nnue/nnue_common.h
src/nnue/nnue_feature_transformer.h
src/uci.cpp