Files
stockfish/src/eval/nnue/features/k.h
T
2019-06-15 17:08:47 +09:00

49 lines
1.4 KiB
C++

// NNUE評価関数の入力特徴量Kの定義
#ifndef _NNUE_FEATURES_K_H_
#define _NNUE_FEATURES_K_H_
#if defined(EVAL_NNUE)
#include "../../../evaluate.h"
#include "features_common.h"
namespace Eval {
namespace NNUE {
namespace Features {
// 特徴量K:玉の位置
class K {
public:
// 特徴量名
static constexpr const char* kName = "K";
// 評価関数ファイルに埋め込むハッシュ値
static constexpr std::uint32_t kHashValue = 0xD3CEE169u;
// 特徴量の次元数
static constexpr IndexType kDimensions = SQUARE_NB * 2;
// 特徴量のうち、同時に値が1となるインデックスの数の最大値
static constexpr IndexType kMaxActiveDimensions = 2;
// 差分計算の代わりに全計算を行うタイミング
static constexpr TriggerEvent kRefreshTrigger = TriggerEvent::kNone;
// 特徴量のうち、値が1であるインデックスのリストを取得する
static void AppendActiveIndices(const Position& pos, Color perspective,
IndexList* active);
// 特徴量のうち、一手前から値が変化したインデックスのリストを取得する
static void AppendChangedIndices(const Position& pos, Color perspective,
IndexList* removed, IndexList* added);
};
} // namespace Features
} // namespace NNUE
} // namespace Eval
#endif // defined(EVAL_NNUE)
#endif