return RawFeatures::kHashValue ^ kOutputDimensions;
}
// Read network parameters
bool ReadParameters(std::istream& stream) {
return RawFeatures::kHashValue ^ kOutputDimensions;
}
// Read network parameters
bool ReadParameters(std::istream& stream) {
return !stream.fail();
}
// Proceed with the difference calculation if possible
bool UpdateAccumulatorIfPossible(const Position& pos) const {
return !stream.fail();
}
// Proceed with the difference calculation if possible
bool UpdateAccumulatorIfPossible(const Position& pos) const {
- void Transform(const Position& pos, OutputType* output, bool refresh) const {
- if (refresh || !UpdateAccumulatorIfPossible(pos)) {
+ void Transform(const Position& pos, OutputType* output) const {
+
+ if (!UpdateAccumulatorIfPossible(pos))
private:
// Calculate cumulative value without using difference calculation
void RefreshAccumulator(const Position& pos) const {
private:
// Calculate cumulative value without using difference calculation
void RefreshAccumulator(const Position& pos) const {
&accumulator.accumulation[perspective][i][0]);
auto column = reinterpret_cast<const __m64*>(&weights_[offset]);
constexpr IndexType kNumChunks = kHalfDimensions / (kSimdWidth / 2);
&accumulator.accumulation[perspective][i][0]);
auto column = reinterpret_cast<const __m64*>(&weights_[offset]);
constexpr IndexType kNumChunks = kHalfDimensions / (kSimdWidth / 2);
}
// Calculate cumulative value using difference calculation
void UpdateAccumulator(const Position& pos) const {
}
// Calculate cumulative value using difference calculation
void UpdateAccumulator(const Position& pos) const {
const auto prev_accumulator = pos.state()->previous->accumulator;
auto& accumulator = pos.state()->accumulator;
IndexType i = 0;
const auto prev_accumulator = pos.state()->previous->accumulator;
auto& accumulator = pos.state()->accumulator;
IndexType i = 0;
- for (IndexType j = 0; j < kHalfDimensions; ++j) {
- accumulator.accumulation[perspective][i][j] -=
- weights_[offset + j];
- }
+ for (IndexType j = 0; j < kHalfDimensions; ++j)
+ accumulator.accumulation[perspective][i][j] -= weights_[offset + j];
- for (IndexType j = 0; j < kHalfDimensions; ++j) {
- accumulator.accumulation[perspective][i][j] +=
- weights_[offset + j];
- }
+ for (IndexType j = 0; j < kHalfDimensions; ++j)
+ accumulator.accumulation[perspective][i][j] += weights_[offset + j];