Print avg bias/weight for affine trasform and feature transformer during training.

This commit is contained in:
Tomasz Sobczyk
2020-10-24 20:03:40 +02:00
committed by nodchip
parent fe766f4f42
commit 0e528995c2
2 changed files with 23 additions and 0 deletions

View File

@@ -241,6 +241,15 @@ namespace Eval::NNUE {
void check_health() {
double abs_bias_sum = 0.0;
double abs_weight_sum = 0.0;
for(auto b : biases_)
abs_bias_sum += std::abs(b);
for(auto w : weights_)
abs_weight_sum += std::abs(w);
auto out = sync_region_cout.new_region();
out << "INFO (check_health):"
@@ -248,7 +257,9 @@ namespace Eval::NNUE {
<< " - " << LayerType::get_name()
<< std::endl;
out << " - avg_abs_bias = " << abs_bias_sum / std::size(biases_) << std::endl;
out << " - avg_abs_bias_diff = " << abs_biases_diff_sum_ / num_biases_diffs_ << std::endl;
out << " - avg_abs_weight = " << abs_weight_sum / std::size(weights_) << std::endl;
out << " - avg_abs_weight_diff = " << abs_weights_diff_sum_ / num_weights_diffs_ << std::endl;
out.unlock();

View File

@@ -349,6 +349,15 @@ namespace Eval::NNUE {
const auto smallest_max_activation = *std::min_element(
std::begin(max_activations_), std::end(max_activations_));
double abs_bias_sum = 0.0;
double abs_weight_sum = 0.0;
for(auto b : biases_)
abs_bias_sum += std::abs(b);
for(auto w : weights_)
abs_weight_sum += std::abs(w);
auto out = sync_region_cout.new_region();
out << "INFO (check_health):"
@@ -370,6 +379,9 @@ namespace Eval::NNUE {
<< " , smallest max activation = " << smallest_max_activation
<< std::endl;
out << " - avg_abs_bias = " << abs_bias_sum / std::size(biases_) << std::endl;
out << " - avg_abs_weight = " << abs_weight_sum / std::size(weights_) << std::endl;
out << " - clipped " << static_cast<double>(num_clipped_) / num_total_ * 100.0 << "% of outputs"
<< std::endl;