diff --git a/src/evaluate.h b/src/evaluate.h index 853aeb5b2..8ed2eb994 100644 --- a/src/evaluate.h +++ b/src/evaluate.h @@ -33,7 +33,7 @@ namespace Eval { // for the build process (profile-build and fishtest) to work. Do not change the // name of the macro or the location where this macro is defined, as it is used // in the Makefile/Fishtest. -#define EvalFileDefaultNameBig "nn-2962dca31855.nnue" +#define EvalFileDefaultNameBig "nn-c288c895ea92.nnue" #define EvalFileDefaultNameSmall "nn-37f18f62d772.nnue" namespace NNUE { diff --git a/src/nnue/nnue_feature_transformer.h b/src/nnue/nnue_feature_transformer.h index 091ae074d..ce23bdf0e 100644 --- a/src/nnue/nnue_feature_transformer.h +++ b/src/nnue/nnue_feature_transformer.h @@ -164,23 +164,13 @@ class FeatureTransformer { if (UseThreats) { - auto combinedWeights = - std::make_unique>(); + read_little_endian(stream, threatWeights.data(), + ThreatInputDimensions * HalfDimensions); + read_leb_128(stream, weights); + auto combinedPsqtWeights = std::make_unique>(); - read_leb_128(stream, *combinedWeights); - - std::transform(combinedWeights->begin(), - combinedWeights->begin() + ThreatInputDimensions * HalfDimensions, - std::begin(threatWeights), - [](WeightType w) { return static_cast(w); }); - - std::copy(combinedWeights->begin() + ThreatInputDimensions * HalfDimensions, - combinedWeights->begin() - + (ThreatInputDimensions + InputDimensions) * HalfDimensions, - std::begin(weights)); - read_leb_128(stream, *combinedPsqtWeights); std::copy(combinedPsqtWeights->begin(), @@ -219,21 +209,13 @@ class FeatureTransformer { if (UseThreats) { - auto combinedWeights = - std::make_unique>(); + write_little_endian(stream, copy->threatWeights.data(), + ThreatInputDimensions * HalfDimensions); + write_leb_128(stream, copy->weights); + auto combinedPsqtWeights = std::make_unique>(); - std::copy(std::begin(copy->threatWeights), - std::begin(copy->threatWeights) + ThreatInputDimensions * HalfDimensions, - combinedWeights->begin()); - - std::copy(std::begin(copy->weights), - std::begin(copy->weights) + InputDimensions * HalfDimensions, - combinedWeights->begin() + ThreatInputDimensions * HalfDimensions); - - write_leb_128(stream, *combinedWeights); - std::copy(std::begin(copy->threatPsqtWeights), std::begin(copy->threatPsqtWeights) + ThreatInputDimensions * PSQTBuckets, combinedPsqtWeights->begin());