Added enpassant feature. Added k-p-cr-ep_256x2-32-32 architecture.

This commit is contained in:
Hisayori Noda
2019-07-07 19:24:46 +09:00
parent 92052bc16b
commit df827ea7ee
5 changed files with 136 additions and 1 deletions
+48
View File
@@ -0,0 +1,48 @@
// NNUE評価関数の入力特徴量Kの定義
#ifndef _NNUE_FEATURES_ENPASSANT_H_
#define _NNUE_FEATURES_ENPASSANT_H_
#if defined(EVAL_NNUE)
#include "../../../evaluate.h"
#include "features_common.h"
namespace Eval {
namespace NNUE {
namespace Features {
// 特徴量K:玉の位置
class EnPassant {
public:
// 特徴量名
static constexpr const char* kName = "EnPassant";
// 評価関数ファイルに埋め込むハッシュ値
static constexpr std::uint32_t kHashValue = 0x02924F91u;
// 特徴量の次元数
static constexpr IndexType kDimensions = 8;
// 特徴量のうち、同時に値が1となるインデックスの数の最大値
static constexpr IndexType kMaxActiveDimensions = 1;
// 差分計算の代わりに全計算を行うタイミング
static constexpr TriggerEvent kRefreshTrigger = TriggerEvent::kAnyPieceMoved;
// 特徴量のうち、値が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