Fix castling rights feature encoding.

This commit is contained in:
Tomasz Sobczyk
2020-09-20 10:39:21 +02:00
committed by nodchip
parent da28ce3339
commit d4737819cd
+3 -3
View File
@@ -27,7 +27,7 @@ namespace Eval {
} }
for (Eval::NNUE::IndexType i = 0; i < kDimensions; ++i) { for (Eval::NNUE::IndexType i = 0; i < kDimensions; ++i) {
if (relative_castling_rights & (i << 1)) { if (relative_castling_rights & (1 << i)) {
active->push_back(i); active->push_back(i);
} }
} }
@@ -55,8 +55,8 @@ namespace Eval {
} }
for (Eval::NNUE::IndexType i = 0; i < kDimensions; ++i) { for (Eval::NNUE::IndexType i = 0; i < kDimensions; ++i) {
if ((relative_previous_castling_rights & (i << 1)) && if ((relative_previous_castling_rights & (1 << i)) &&
(relative_current_castling_rights & (i << 1)) == 0) { (relative_current_castling_rights & (1 << i)) == 0) {
removed->push_back(i); removed->push_back(i);
} }
} }