aboutsummaryrefslogtreecommitdiff
path: root/include/nn.c
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2026-09-11 18:36:10 +0100
committertslil <tslil@posteo.de>2026-09-12 15:47:15 +0100
commita361728f39812e25599323c52510c0eb3131bd90 (patch)
treef2772377790e6f2eecaa5b9d9553004d8b50582e /include/nn.c
parent6e90f1145b2c5c0f2dcc82d21ec45432274b8cad (diff)
flood fill for roads, fix dragon, memoise leaf eval, enable diagonal in nn_train.py
Diffstat (limited to 'include/nn.c')
-rw-r--r--include/nn.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/nn.c b/include/nn.c
index 9b241a1..7a42a02 100644
--- a/include/nn.c
+++ b/include/nn.c
@@ -91,10 +91,12 @@ void nn_prepare_input(float *cur_board, tak_state_p state,
const float embedding[NN_N_EMB]) {
const unsigned int n_cells = state->board_size * state->board_size;
nn_prepare_head(cur_board, state);
- nn_cell_idxs(prepared_idxs, state);
+ for (unsigned int loc = 0; loc < n_cells; loc++) {
+ const uint8_t idx = cell_idx_at(state, loc);
+ prepared_idxs[loc] = idx;
+ cur_board[2 + loc] = embedding[idx];
+ }
prepared_hash = state->hash;
- for (unsigned int loc = 0; loc < n_cells; loc++)
- cur_board[2 + loc] = embedding[prepared_idxs[loc]];
}
// Copy the cell indices produced by the most recent nn_prepare_input into out