mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 10:36:26 +08:00
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
This commit is contained in:
committed by
Joost VandeVondele
parent
d777ea79ff
commit
58054fd0fa
@@ -20,6 +20,7 @@
|
||||
#define EVALUATE_H_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <optional>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
@@ -44,8 +45,9 @@ namespace Eval {
|
||||
|
||||
Value evaluate(const Position& pos);
|
||||
bool load_eval(std::string name, std::istream& stream);
|
||||
bool save_eval(std::ostream& stream);
|
||||
void init();
|
||||
void export_net();
|
||||
void export_net(const std::optional<std::string>& filename);
|
||||
void verify();
|
||||
|
||||
} // namespace NNUE
|
||||
|
||||
Reference in New Issue
Block a user