aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDylan <boss@tehbox.org>2026-11-09 16:38:13 +1300
committerDylan <boss@tehbox.org>2026-11-09 16:38:13 +1300
commit478e7568f5eda9780d1409bb8dccc86221126281 (patch)
tree2f4ec7a90d0c65505b757bdce0ddd2f9778ccaa5 /src/main.rs
parent0fd43eb6d9a4bae8d4c29fd614f9cf2a362f7b7c (diff)
downloadtigers-and-sheep-478e7568f5eda9780d1409bb8dccc86221126281.tar.gz
tigers-and-sheep-478e7568f5eda9780d1409bb8dccc86221126281.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 5 insertions, 1 deletions
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<TrainArgs> for train::Config
@@ -171,6 +174,7 @@ impl From<TrainArgs> for train::Config
batch_size: args.batch_size,
learning_rate: args.learning_rate,
match_games: args.match_games,
+ match_every: args.match_every,
}
}
}