From 72c5056c5aa614d9a86f8b760955cfcf96c44be4 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Sat, 21 Jan 2023 19:30:45 +0100 Subject: might as well enable size 6 Same network architecture, same training principle. Predictably this is too slow. Also statically allocate state in driver programmes. --- include/negamax.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/negamax.c') 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); -- cgit v1.3.1