mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 14:27:45 +00:00
Correctly account for factors when computing the average absolute weight of the feature transformer.
This commit is contained in:
@@ -621,8 +621,19 @@ namespace Eval::NNUE {
|
|||||||
for(auto b : biases_)
|
for(auto b : biases_)
|
||||||
abs_bias_sum += std::abs(b);
|
abs_bias_sum += std::abs(b);
|
||||||
|
|
||||||
for(auto w : weights_)
|
std::vector<TrainingFeature> training_features;
|
||||||
abs_weight_sum += std::abs(w);
|
for (IndexType j = 0; j < RawFeatures::kDimensions; ++j)
|
||||||
|
{
|
||||||
|
training_features.clear();
|
||||||
|
Features::Factorizer<RawFeatures>::append_training_features(
|
||||||
|
j, &training_features);
|
||||||
|
|
||||||
|
for (const auto& feature : training_features) {
|
||||||
|
for (IndexType i = 0; i < kHalfDimensions; ++i) {
|
||||||
|
abs_weight_sum += std::abs(weights_[kHalfDimensions * feature.get_index() + i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto out = sync_region_cout.new_region();
|
auto out = sync_region_cout.new_region();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user