Add layer info for check_health. Print subsequent infos from the same scope with "-->" instead of "INFO:" for clarity.

This commit is contained in:
Tomasz Sobczyk
2020-10-24 11:58:53 +02:00
committed by nodchip
parent 8ddef320e6
commit c49ae541c4
3 changed files with 22 additions and 10 deletions
+7 -2
View File
@@ -99,8 +99,13 @@ namespace Eval::NNUE {
const auto smallest_max_activation = *std::min_element(
std::begin(max_activations_), std::end(max_activations_));
std::cout << "INFO: largest min activation = " << largest_min_activation
<< ", smallest max activation = " << smallest_max_activation
std::cout << "INFO (check_health):"
<< " layer = " << LayerType::kLayerIndex
<< " , name = " << LayerType::get_name()
<< std::endl;
std::cout << "--> largest min activation = " << largest_min_activation
<< " , smallest max activation = " << smallest_max_activation
<< std::endl;
std::fill(std::begin(min_activations_), std::end(min_activations_),
+13 -6
View File
@@ -330,25 +330,32 @@ namespace Eval::NNUE {
// Check if there are any problems with learning
void check_health() {
std::cout << "INFO: observed " << observed_features.count()
<< " (out of " << kInputDimensions << ") features" << std::endl;
std::cout << "INFO (check_health):"
<< " layer = " << LayerType::kLayerIndex
<< " , name = " << LayerType::get_name()
<< std::endl;
std::cout << "--> observed " << observed_features.count()
<< " (out of " << kInputDimensions << ") features"
<< std::endl;
constexpr LearnFloatType kPreActivationLimit =
std::numeric_limits<typename LayerType::WeightType>::max() /
kWeightScale;
std::cout << "INFO: (min, max) of pre-activations = "
std::cout << "--> (min, max) of pre-activations = "
<< min_pre_activation_ << ", "
<< max_pre_activation_ << " (limit = "
<< kPreActivationLimit << ")" << std::endl;
<< kPreActivationLimit << ")"
<< std::endl;
const auto largest_min_activation = *std::max_element(
std::begin(min_activations_), std::end(min_activations_));
const auto smallest_max_activation = *std::min_element(
std::begin(max_activations_), std::end(max_activations_));
std::cout << "INFO: largest min activation = " << largest_min_activation
<< ", smallest max activation = " << smallest_max_activation
std::cout << "--> largest min activation = " << largest_min_activation
<< " , smallest max activation = " << smallest_max_activation
<< std::endl;
std::fill(std::begin(min_activations_), std::end(min_activations_),