How mncrftfrcnm/making-fly-play-chess works
This repository is an experimental chess agent that evaluates positions with a fixed fruit-fly connectome and learns a readout through self-play. The main user workflow is to start a game, encode each chess position, score legal moves, and show the game and neural activity in a Gradio interface. A separate trainer builds and updates the model; an optional FlyGym interface maps activity to rendered fly movement. README documents a connectome-versus-classical comparison notebook, but its implementation was not sampled, so its internal links are omitted.
Main entry points: fly_chess_inference.py Position readout · fly_chess_inference_flygym.py FlyGym game interface · gif_gen_flygym.py Fly chess GIF · fly_chess_model.joblib Trained model
Components 15
Chess inference
- Game interface
scripts/fly_chess_inference.py - Game orchestration
scripts/fly_chess_inference.py - Move selection
scripts/fly_chess_inference.py
Connectome model
- Board encoding
scripts/fly_chess_inference.py - Connectome propagation
scripts/fly_chess_inference.py - Position readout
scripts/fly_chess_inference.py - Trained model
fly_chess_model.joblib
Model training
- Self-play trainer
scripts/fly_chess_trainer.py - Fly connectivity data
scripts/fly_chess_trainer.py
Visualization and research
- FlyGym game interface
scripts/fly_chess_inference_flygym.py - Neural motion renderer
scripts/fly_chess_inference_flygym.py - Fly chess GIF
scripts/gif_gen_flygym.py - Chess GIF frames
scripts/gif_gen.py - Architecture comparison
notebooks/connectome_vs_classical_architectures.ipynb
Other components
- Player
Connections 17
- Player → Game interface: plays through
README.md - Game interface → Game orchestration: dispatches actions
scripts/fly_chess_inference.py - Game orchestration → Move selection: requests move
scripts/fly_chess_inference.py - Move selection → Board encoding: scores positions
README.md - Board encoding → Connectome propagation: feeds features
README.md - Connectome propagation → Position readout: produces activity
README.md - Position readout → Move selection: returns score
scripts/fly_chess_inference.py - Trained model → Position readout: provides weights
README.md - Fly connectivity data → Self-play trainer: supplies connectivity
README.md - Self-play trainer → Trained model: saves trained model
README.md - Player → FlyGym game interface: plays with rendering
README.md - FlyGym game interface → Game orchestration: delegates game actions
scripts/fly_chess_inference_flygym.py - FlyGym game interface → Neural motion renderer: requests fly output
scripts/fly_chess_inference_flygym.py - Neural motion renderer → Position readout: uses neuron activity
scripts/fly_chess_inference_flygym.py - Fly chess GIF → Neural motion renderer: renders fly frames
scripts/gif_gen_flygym.py - Fly chess GIF → Chess GIF frames: uses board rendering
scripts/gif_gen_flygym.py - Architecture comparison → Connectome propagation: compares architectures
README.md