Removed EVAL_NNUE macro.

This commit is contained in:
nodchip
2020-09-08 22:45:29 +09:00
parent 41b7674aee
commit a6013557f2
31 changed files with 65 additions and 223 deletions
-2
View File
@@ -184,13 +184,11 @@ namespace Eval::NNUE {
Initialize();
#if defined(EVAL_NNUE)
if (Options["SkipLoadingEval"])
{
std::cout << "info string SkipLoadingEval set to true, Net not loaded!" << std::endl;
return true;
}
#endif
fileName = evalFile;
+2 -2
View File
@@ -1,6 +1,6 @@
// Code for learning NNUE evaluation function
#if defined(EVAL_LEARN) && defined(EVAL_NNUE)
#if defined(EVAL_LEARN)
#include <random>
#include <fstream>
@@ -229,4 +229,4 @@ double get_eta() {
} // namespace Eval
#endif // defined(EVAL_LEARN) && defined(EVAL_NNUE)
#endif // defined(EVAL_LEARN)
+2 -2
View File
@@ -3,7 +3,7 @@
#ifndef _EVALUATE_NNUE_LEARNER_H_
#define _EVALUATE_NNUE_LEARNER_H_
#if defined(EVAL_LEARN) && defined(EVAL_NNUE)
#if defined(EVAL_LEARN)
#include "../learn/learn.h"
@@ -41,6 +41,6 @@ void CheckHealth();
} // namespace Eval
#endif // defined(EVAL_LEARN) && defined(EVAL_NNUE)
#endif // defined(EVAL_LEARN)
#endif
-4
View File
@@ -1,7 +1,5 @@
//Definition of input feature quantity K of NNUE evaluation function
#if defined(EVAL_NNUE)
#include "castling_right.h"
#include "index_list.h"
@@ -69,5 +67,3 @@ namespace Eval {
} // namespace NNUE
} // namespace Eval
#endif // defined(EVAL_NNUE)
-4
View File
@@ -3,8 +3,6 @@
#ifndef _NNUE_FEATURES_CASTLING_RIGHT_H_
#define _NNUE_FEATURES_CASTLING_RIGHT_H_
#if defined(EVAL_NNUE)
#include "../../evaluate.h"
#include "features_common.h"
@@ -43,6 +41,4 @@ namespace Eval {
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif
-4
View File
@@ -1,7 +1,5 @@
//Definition of input feature quantity K of NNUE evaluation function
#if defined(EVAL_NNUE)
#include "enpassant.h"
#include "index_list.h"
@@ -43,5 +41,3 @@ namespace Eval {
} // namespace NNUE
} // namespace Eval
#endif // defined(EVAL_NNUE)
-4
View File
@@ -3,8 +3,6 @@
#ifndef _NNUE_FEATURES_ENPASSANT_H_
#define _NNUE_FEATURES_ENPASSANT_H_
#if defined(EVAL_NNUE)
#include "../../evaluate.h"
#include "features_common.h"
@@ -43,6 +41,4 @@ namespace Eval {
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif
-4
View File
@@ -1,7 +1,5 @@
//Definition of input features HalfRelativeKP of NNUE evaluation function
#if defined(EVAL_NNUE)
#include "half_relative_kp.h"
#include "index_list.h"
@@ -74,5 +72,3 @@ template class HalfRelativeKP<Side::kEnemy>;
} // namespace NNUE
} // namespace Eval
#endif // defined(EVAL_NNUE)
-4
View File
@@ -3,8 +3,6 @@
#ifndef _NNUE_FEATURES_HALF_RELATIVE_KP_H_
#define _NNUE_FEATURES_HALF_RELATIVE_KP_H_
#if defined(EVAL_NNUE)
#include "../../evaluate.h"
#include "features_common.h"
@@ -60,6 +58,4 @@ class HalfRelativeKP {
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif
-4
View File
@@ -1,7 +1,5 @@
//Definition of input feature quantity K of NNUE evaluation function
#if defined(EVAL_NNUE)
#include "k.h"
#include "index_list.h"
@@ -54,5 +52,3 @@ void K::AppendChangedIndices(
} // namespace NNUE
} // namespace Eval
#endif // defined(EVAL_NNUE)
-4
View File
@@ -3,8 +3,6 @@
#ifndef _NNUE_FEATURES_K_H_
#define _NNUE_FEATURES_K_H_
#if defined(EVAL_NNUE)
#include "../../evaluate.h"
#include "features_common.h"
@@ -47,6 +45,4 @@ private:
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif
-4
View File
@@ -1,7 +1,5 @@
//Definition of input feature P of NNUE evaluation function
#if defined(EVAL_NNUE)
#include "p.h"
#include "index_list.h"
@@ -52,5 +50,3 @@ void P::AppendChangedIndices(
} // namespace NNUE
} // namespace Eval
#endif // defined(EVAL_NNUE)
-4
View File
@@ -3,8 +3,6 @@
#ifndef _NNUE_FEATURES_P_H_
#define _NNUE_FEATURES_P_H_
#if defined(EVAL_NNUE)
#include "../../evaluate.h"
#include "features_common.h"
@@ -47,6 +45,4 @@ class P {
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif
-4
View File
@@ -3,8 +3,6 @@
#ifndef _NNUE_LAYERS_SUM_H_
#define _NNUE_LAYERS_SUM_H_
#if defined(EVAL_NNUE)
#include "../nnue_common.h"
namespace Eval {
@@ -158,6 +156,4 @@ class Sum<PreviousLayer> {
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif
+2 -2
View File
@@ -1,6 +1,6 @@
// USI extended command for NNUE evaluation function
#if defined(ENABLE_TEST_CMD) && defined(EVAL_NNUE)
#if defined(ENABLE_TEST_CMD)
#include "../thread.h"
#include "../uci.h"
@@ -198,4 +198,4 @@ void TestCommand(Position& pos, std::istream& stream) {
} // namespace Eval
#endif // defined(ENABLE_TEST_CMD) && defined(EVAL_NNUE)
#endif // defined(ENABLE_TEST_CMD)
+2 -2
View File
@@ -3,7 +3,7 @@
#ifndef _NNUE_TEST_COMMAND_H_
#define _NNUE_TEST_COMMAND_H_
#if defined(ENABLE_TEST_CMD) && defined(EVAL_NNUE)
#if defined(ENABLE_TEST_CMD)
namespace Eval {
@@ -16,6 +16,6 @@ void TestCommand(Position& pos, std::istream& stream);
} // namespace Eval
#endif // defined(ENABLE_TEST_CMD) && defined(EVAL_NNUE)
#endif // defined(ENABLE_TEST_CMD)
#endif
-4
View File
@@ -3,8 +3,6 @@
#ifndef _NNUE_TRAINER_FEATURES_FACTORIZER_H_
#define _NNUE_TRAINER_FEATURES_FACTORIZER_H_
#if defined(EVAL_NNUE)
#include "../../nnue_common.h"
#include "../trainer.h"
@@ -105,6 +103,4 @@ constexpr std::size_t GetArrayLength(const T (&/*array*/)[N]) {
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif
@@ -3,8 +3,6 @@
#ifndef _NNUE_TRAINER_FEATURES_FACTORIZER_FEATURE_SET_H_
#define _NNUE_TRAINER_FEATURES_FACTORIZER_FEATURE_SET_H_
#if defined(EVAL_NNUE)
#include "../../features/feature_set.h"
#include "factorizer.h"
@@ -99,6 +97,4 @@ public:
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif
@@ -3,8 +3,6 @@
#ifndef _NNUE_TRAINER_FEATURES_FACTORIZER_HALF_KP_H_
#define _NNUE_TRAINER_FEATURES_FACTORIZER_HALF_KP_H_
#if defined(EVAL_NNUE)
#include "../../features/half_kp.h"
#include "../../features/p.h"
#include "../../features/half_relative_kp.h"
@@ -98,6 +96,4 @@ constexpr FeatureProperties Factorizer<HalfKP<AssociatedKing>>::kProperties[];
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#ifndef _NNUE_TRAINER_H_
#define _NNUE_TRAINER_H_
#if defined(EVAL_LEARN) && defined(EVAL_NNUE)
#if defined(EVAL_LEARN)
#include "../nnue_common.h"
#include "../features/index_list.h"
@@ -120,6 +120,6 @@ std::shared_ptr<T> MakeAlignedSharedPtr(ArgumentTypes&&... arguments) {
} // namespace Eval
#endif // defined(EVAL_LEARN) && defined(EVAL_NNUE)
#endif // defined(EVAL_LEARN)
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#ifndef _NNUE_TRAINER_AFFINE_TRANSFORM_H_
#define _NNUE_TRAINER_AFFINE_TRANSFORM_H_
#if defined(EVAL_LEARN) && defined(EVAL_NNUE)
#if defined(EVAL_LEARN)
#include "../../learn/learn.h"
#include "../layers/affine_transform.h"
@@ -296,6 +296,6 @@ class Trainer<Layers::AffineTransform<PreviousLayer, OutputDimensions>> {
} // namespace Eval
#endif // defined(EVAL_LEARN) && defined(EVAL_NNUE)
#endif // defined(EVAL_LEARN)
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#ifndef _NNUE_TRAINER_CLIPPED_RELU_H_
#define _NNUE_TRAINER_CLIPPED_RELU_H_
#if defined(EVAL_LEARN) && defined(EVAL_NNUE)
#if defined(EVAL_LEARN)
#include "../../learn/learn.h"
#include "../layers/clipped_relu.h"
@@ -137,6 +137,6 @@ class Trainer<Layers::ClippedReLU<PreviousLayer>> {
} // namespace Eval
#endif // defined(EVAL_LEARN) && defined(EVAL_NNUE)
#endif // defined(EVAL_LEARN)
#endif
@@ -3,7 +3,7 @@
#ifndef _NNUE_TRAINER_FEATURE_TRANSFORMER_H_
#define _NNUE_TRAINER_FEATURE_TRANSFORMER_H_
#if defined(EVAL_LEARN) && defined(EVAL_NNUE)
#if defined(EVAL_LEARN)
#include "../../learn/learn.h"
#include "../nnue_feature_transformer.h"
@@ -372,6 +372,6 @@ class Trainer<FeatureTransformer> {
} // namespace Eval
#endif // defined(EVAL_LEARN) && defined(EVAL_NNUE)
#endif // defined(EVAL_LEARN)
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#ifndef _NNUE_TRAINER_INPUT_SLICE_H_
#define _NNUE_TRAINER_INPUT_SLICE_H_
#if defined(EVAL_LEARN) && defined(EVAL_NNUE)
#if defined(EVAL_LEARN)
#include "../../learn/learn.h"
#include "../layers/input_slice.h"
@@ -246,6 +246,6 @@ class Trainer<Layers::InputSlice<OutputDimensions, Offset>> {
} // namespace Eval
#endif // defined(EVAL_LEARN) && defined(EVAL_NNUE)
#endif // defined(EVAL_LEARN)
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#ifndef _NNUE_TRAINER_SUM_H_
#define _NNUE_TRAINER_SUM_H_
#if defined(EVAL_LEARN) && defined(EVAL_NNUE)
#if defined(EVAL_LEARN)
#include "../../learn/learn.h"
#include "../layers/sum.h"
@@ -185,6 +185,6 @@ class Trainer<Layers::Sum<PreviousLayer>> {
} // namespace Eval
#endif // defined(EVAL_LEARN) && defined(EVAL_NNUE)
#endif // defined(EVAL_LEARN)
#endif