mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 13:17:44 +00:00
55a6b2bdc4
# Conflicts: # README.md # Readme.md # src/Makefile # src/evaluate.cpp # src/evaluate.h # src/misc.cpp # src/nnue/architectures/halfkp_256x2-32-32.h # src/nnue/evaluate_nnue.cpp # src/nnue/evaluate_nnue.h # src/nnue/features/feature_set.h # src/nnue/features/features_common.h # src/nnue/features/half_kp.cpp # src/nnue/features/half_kp.h # src/nnue/features/index_list.h # src/nnue/layers/affine_transform.h # src/nnue/layers/clipped_relu.h # src/nnue/layers/input_slice.h # src/nnue/nnue_accumulator.h # src/nnue/nnue_architecture.h # src/nnue/nnue_common.h # src/nnue/nnue_feature_transformer.h # src/position.cpp # src/position.h # src/types.h # src/ucioption.cpp # stockfish.md
49 lines
1.5 KiB
C++
49 lines
1.5 KiB
C++
//Definition of input feature P of NNUE evaluation function
|
||
|
||
#ifndef _NNUE_FEATURES_P_H_
|
||
#define _NNUE_FEATURES_P_H_
|
||
|
||
#if defined(EVAL_NNUE)
|
||
|
||
#include "../../evaluate.h"
|
||
#include "features_common.h"
|
||
|
||
namespace Eval {
|
||
|
||
namespace NNUE {
|
||
|
||
namespace Features {
|
||
|
||
// Feature P: PieceSquare of pieces other than balls
|
||
class P {
|
||
public:
|
||
// feature quantity name
|
||
static constexpr const char* kName = "P";
|
||
// Hash value embedded in the evaluation function file
|
||
static constexpr std::uint32_t kHashValue = 0x764CFB4Bu;
|
||
// number of feature dimensions
|
||
static constexpr IndexType kDimensions = PieceSquare::PS_END;
|
||
// The maximum value of the number of indexes whose value is 1 at the same time among the feature values
|
||
static constexpr IndexType kMaxActiveDimensions = PieceId::PIECE_ID_KING;
|
||
// Timing of full calculation instead of difference calculation
|
||
static constexpr TriggerEvent kRefreshTrigger = TriggerEvent::kNone;
|
||
|
||
// Get a list of indices with a value of 1 among the features
|
||
static void AppendActiveIndices(const Position& pos, Color perspective,
|
||
IndexList* active);
|
||
|
||
// Get a list of indices whose values have changed from the previous one in the feature quantity
|
||
static void AppendChangedIndices(const Position& pos, Color perspective,
|
||
IndexList* removed, IndexList* added);
|
||
};
|
||
|
||
} // namespace Features
|
||
|
||
} // namespace NNUE
|
||
|
||
} // namespace Eval
|
||
|
||
#endif // defined(EVAL_NNUE)
|
||
|
||
#endif
|