Correctly account for factors when computing the average absolute weight of the feature transformer.

This commit is contained in:
Tomasz Sobczyk
2020-12-24 13:49:44 +01:00
committed by nodchip
parent 2061be4730
commit 7636bcccd1

View File

@@ -621,8 +621,19 @@ namespace Eval::NNUE {
for(auto b : biases_)
abs_bias_sum += std::abs(b);
for(auto w : weights_)
abs_weight_sum += std::abs(w);
std::vector<TrainingFeature> training_features;
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();