diff options
| author | Dylan <boss@tehbox.org> | 2026-11-05 13:46:28 +1300 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-11-05 13:46:28 +1300 |
| commit | 94f3df190a91898eb344b9214a57eb31792bcb1c (patch) | |
| tree | db123ed498e84453d89da4df99253e56e6ded259 /src/claude-player.rs | |
| parent | 8b6323efba32da9e3651ce882c02a6e7a6671f23 (diff) | |
| download | tigers-and-sheep-94f3df190a91898eb344b9214a57eb31792bcb1c.tar.gz tigers-and-sheep-94f3df190a91898eb344b9214a57eb31792bcb1c.zip | |
feat: Neural network opponent trained by self-play
- NeuralPlayer: a MinimaxPlayer that scores positions with a small MLP
(network.rs, hand-written backprop and Adam, no new dependencies)
- train subcommand: self-play with TD(lambda) targets, cut at random
exploration moves so sheep blunders don't bias the net towards tigers
- neural subcommand: play against a trained network
- evaluate now gets the side to move
- Board symmetries; the search cache keys by the canonical board, which
halves the depth-9 bench time with identical moves and scores
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/claude-player.rs')
| -rw-r--r-- | src/claude-player.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/claude-player.rs b/src/claude-player.rs index 5cbd794..c25c5e1 100644 --- a/src/claude-player.rs +++ b/src/claude-player.rs @@ -39,7 +39,7 @@ impl MinimaxPlayer for ClaudePlayer /// - jumps the tigers could make right now (sheep left hanging); /// - tigers boxed in with no move at all, since trapping every tiger wins for the sheep; /// - tiger mobility in general, since the sheep win by squeezing it to zero. - fn evaluate(&mut self, board: &GameBoard) -> f32 + fn evaluate(&mut self, board: &GameBoard, _turn: Turn) -> f32 { let dead = TOTAL_SHEEP - board.sheep_count() - board.sheep_left(); |
