diff options
| author | tslil clingman <tslil@posteo.de> | 2023-01-21 19:30:45 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | 0e81096d5ecb6027814e7aae10b461e774f96407 (patch) | |
| tree | 6cedfe4b3fad3770a5210f5e5d5ad205c17f4b0f /include/negamax.c | |
| parent | cb2b78ced27fc7996ed11c3450f69138d7d1b61f (diff) | |
might as well enable size 6
Same network architecture, same training principle. Predictably this is
too slow.
Also statically allocate state in driver programmes.
Diffstat (limited to 'include/negamax.c')
| -rw-r--r-- | include/negamax.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/negamax.c b/include/negamax.c index 0ec40e5..584b43c 100644 --- a/include/negamax.c +++ b/include/negamax.c @@ -26,6 +26,7 @@ const float infty = 3.0; char negamax_ptn[9]; uint8_t negamax_search_depth = 3; static uint64_t negamax_best_action; +static nn_function evaluate; // =================================================================== // Helper declarations @@ -43,6 +44,12 @@ void negamax_init(const uint8_t new_board_size) { action_list_init(new_board_size); zobrist_init(new_board_size); tt_init(); + + if (new_board_size == 5) { + evaluate = &nn1986_evaluate_black_win; + } else { + evaluate = &nn2690_evaluate_black_win; + } } void negamax_free(void) { zobrist_free(); } @@ -132,7 +139,7 @@ static float negamax(tak_state_p state, const uint8_t cur_depth, node_value = -negamax(state, cur_depth - 1, init_depth, -beta, -alpha, -colour, zobrist_compute(state)); } else { - node_value = colour * nn1986_evaluate_black_win(state); + node_value = colour * evaluate(state); } action_undo(state, node->action); |
