From 174519bec5f320a7afbb3fede87dbfe412684a7b Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Mon, 30 Dec 2024 18:37:49 -0500 Subject: [PATCH] fix: training pipeline bugs - invalid integer cast - "resuming" message when not resuming --- nnue/.gitignore | 1 + nnue/process_pgn_data.py | 1 + src/eval.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nnue/.gitignore b/nnue/.gitignore index 6172dfa..e88566d 100644 --- a/nnue/.gitignore +++ b/nnue/.gitignore @@ -1,2 +1,3 @@ batches/ venv/ +train_data/ diff --git a/nnue/process_pgn_data.py b/nnue/process_pgn_data.py index c3790e8..5681d7c 100755 --- a/nnue/process_pgn_data.py +++ b/nnue/process_pgn_data.py @@ -219,6 +219,7 @@ async def main(): if skipped: logging.info("Resuming at file '%s'.", file) + skipped = False else: logging.info("Reading file '%s'.", file) diff --git a/src/eval.rs b/src/eval.rs index 14c8161..21514db 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -397,7 +397,7 @@ pub fn eval_metrics(board: &Board) -> EvalMetrics { let king_distance_eval = -advantage * i32::try_from(king_distance).unwrap() * max(7 - phase, 0) / 100; - let eval = pst_eval + king_distance_eval; + let eval = (pst_eval + king_distance_eval).clamp(i16::MIN.into(), i16::MAX.into()); EvalMetrics { pst_eval,