mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 11:06:58 +08: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_)
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user