From 478e7568f5eda9780d1409bb8dccc86221126281 Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 9 Nov 2026 16:38:13 +1300 Subject: feat: Multi-threaded training; play matches every 10 generations Gradients and losses are computed on rayon's pool in fixed-size chunks summed in order, so the weights are the same on any number of threads. Self-play uses the same pool, and the output shows the training time. The matches against the earlier network and ClaudePlayer now run only every --match-every generations (default 10), against the generation that last played them, read back from its saved file. Co-Authored-By: Claude Opus 5.5 --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 5a3c798..5237100 100644 --- a/src/main.rs +++ b/src/main.rs @@ -145,9 +145,12 @@ struct TrainArgs /// Adam's learning rate #[arg(long, default_value_t = train::Config::default().learning_rate)] learning_rate: f32, - /// Games against ClaudePlayer, and against the previous generation, after each generation + /// Games against ClaudePlayer, and against the generation that last played them #[arg(long, default_value_t = train::Config::default().match_games)] match_games: usize, + /// Play those matches only every this many generations + #[arg(long, default_value_t = train::Config::default().match_every)] + match_every: usize, } impl From for train::Config @@ -171,6 +174,7 @@ impl From for train::Config batch_size: args.batch_size, learning_rate: args.learning_rate, match_games: args.match_games, + match_every: args.match_every, } } } -- cgit v1.3.1