Print the used factorizer when intializing training.

This commit is contained in:
Tomasz Sobczyk
2020-10-26 13:52:35 +01:00
committed by nodchip
parent e01397c674
commit ba390a7f9a
4 changed files with 37 additions and 0 deletions

View File

@@ -68,6 +68,11 @@ namespace Eval::NNUE {
out << std::endl;
out << "Factorizers:\n"
<< Features::Factorizer<RawFeatures>::get_factorizers_string() << std::endl;
out << std::endl;
assert(feature_transformer);
assert(network);

View File

@@ -13,6 +13,14 @@ namespace Eval::NNUE::Features {
template <typename FeatureType>
class Factorizer {
public:
static constexpr std::string get_name() {
return std::string("No factorizer");
}
static constexpr std::string get_factorizers_string() {
return " - " + get_name();
}
// Get the dimensionality of the learning feature
static constexpr IndexType get_dimensions() {
return FeatureType::kDimensions;

View File

@@ -21,6 +21,14 @@ namespace Eval::NNUE::Features {
static constexpr IndexType kBaseDimensions =
FeatureSet<FirstFeatureType, RemainingFeatureTypes...>::kDimensions;
static constexpr std::string get_factorizers_string() {
std::string str = " - ";
str += Head::get_name();
str += '\n';
str += Tail::get_factorizers_string();
return str;
}
// Get the dimensionality of the learning feature
static constexpr IndexType get_dimensions() {
return Head::get_dimensions() + Tail::get_dimensions();
@@ -73,6 +81,14 @@ namespace Eval::NNUE::Features {
// number of dimensions of original input features
static constexpr IndexType kBaseDimensions = FeatureType::kDimensions;
static constexpr std::string get_name() {
return FeatureType::kName;
}
static constexpr std::string get_factorizers_string() {
return " - " + get_name();
}
// Get the dimensionality of the learning feature
static constexpr IndexType get_dimensions() {
return Factorizer<FeatureType>::get_dimensions();

View File

@@ -45,6 +45,14 @@ namespace Eval::NNUE::Features {
static_assert(get_array_length(kProperties) == kNumTrainingFeatureTypes, "");
public:
static constexpr std::string get_name() {
return std::string("Factorizer<") + FeatureType::kName + ">";
}
static constexpr std::string get_factorizers_string() {
return " - " + get_name();
}
// Get the dimensionality of the learning feature
static constexpr IndexType get_dimensions() {
return get_active_dimensions(kProperties);