{"id":28499061,"url":"https://github.com/goodcoder666/katac4","last_synced_at":"2025-08-17T16:52:23.085Z","repository":{"id":297792567,"uuid":"997906034","full_name":"GoodCoder666/katac4","owner":"GoodCoder666","description":"An AlphaZero engine for Saiblo Connect4, featuring a pure Python implementation of key KataGo techniques.","archived":false,"fork":false,"pushed_at":"2025-06-10T13:52:50.000Z","size":2195,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-03T22:35:27.806Z","etag":null,"topics":["alphazero","board-game","connect-four","connect4-ai","katago","mcts","monte-carlo-tree-search","pytorch","reinforcement-learning","rl","torchscript"],"latest_commit_sha":null,"homepage":"https://goodcoder666.github.io/p/katac4/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodCoder666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-07T12:56:02.000Z","updated_at":"2025-06-28T15:56:19.000Z","dependencies_parsed_at":"2025-06-07T14:38:18.383Z","dependency_job_id":null,"html_url":"https://github.com/GoodCoder666/katac4","commit_stats":null,"previous_names":["goodcoder666/katac4"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GoodCoder666/katac4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodCoder666%2Fkatac4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodCoder666%2Fkatac4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodCoder666%2Fkatac4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodCoder666%2Fkatac4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodCoder666","download_url":"https://codeload.github.com/GoodCoder666/katac4/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodCoder666%2Fkatac4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270877279,"owners_count":24661121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alphazero","board-game","connect-four","connect4-ai","katago","mcts","monte-carlo-tree-search","pytorch","reinforcement-learning","rl","torchscript"],"created_at":"2025-06-08T14:30:32.842Z","updated_at":"2025-08-17T16:52:23.019Z","avatar_url":"https://github.com/GoodCoder666.png","language":"Python","readme":"# katac4\n\nAn AlphaZero engine for [Saiblo Connect4](https://www.saiblo.net/game/3), featuring a pure Python implementation of key [KataGo](https://github.com/lightvector/KataGo) techniques.\n\n## Project Structure\n\n```\nkatac4/\n├── README.md        # This file\n│\n├── runs/            # TensorBoard logs\n├── weights/         # Model checkpoints for each training run\n│\n├── docs/            # Documentation files\n│   └── methods.md    # Overview of improvements over original AlphaZero\n│\n├── saiblo/          # Saiblo Connect4 submission package\n│   ├── main.py       # Entry point\n│   ├── game.py       # Standalone game environment (with zobrist hash)\n│   └── search.py     # Monte Carlo Graph Search, used during online play\n│\n├── train.py         # Main training script\n├── model.py         # Neural network model definition (b3c128nbt)\n├── game.py          # Game environment\n├── mcts.py          # Monte Carlo Tree Search, used during training\n├── elo_eval.py      # Script for evaluating model ELO ratings\n├── elo.json         # ELO ratings generated by elo_eval.py\n├── elo_plot.py      # Plots ELO rating progression\n├── export_model.py  # Converts model to TorchScript for deployment\n├── benchmark.py     # Benchmarks model performance\n└── human_play.py    # Allows human interaction with the model\n```\n\n## Quick Start\n\n### Self-Play Training\n\nBefore starting self-play training, you may want to adjust a few parameters in `train.py`:\n\n* `epochs`: Total number of training epochs\n* `epoch_size`: Number of self-play games per epoch\n* `parallel_games`: Number of games run in parallel\n* `num_gpus`: Number of GPUs to utilize\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e To exactly reproduce the most recent training run, **do not change** the default parameter values in the code.\n\nTo begin training, run:\n\n```bash\npython3 train.py\n```\n\nModel checkpoints will be saved to the `weights/` directory. To monitor progress with TensorBoard:\n\n```bash\ntensorboard --logdir runs\n```\n\n### ELO Evaluation\n\nTo evaluate model performance using ELO, edit the `ai_list` and `weight_format` variables in `elo_eval.py` as needed. Then run:\n\n```bash\npython3 elo_eval.py\n```\n\nModels will compete in randomized pairings, with results saved to `elo.json`. To visualize the rating progression:\n\n```bash\npython3 elo_plot.py\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e The ELO evaluation process is computationally intensive. For reference, the most recent evaluation was based on approximately 70,000 games and required 2.5 days to complete on four RTX 4090 GPUs.\n\n### Submitting to Saiblo\n\nSelect your best-performing model checkpoint (typically the final one or the one with highest ELO), and set its path in `export_model.py`. Export it to TorchScript format by running:\n\n```bash\npython3 export_model.py\n```\n\nThis will generate `model.pt` in the `saiblo/` directory. To create your submission, zip **only the files** inside the `saiblo/` folder—**do not include the folder itself** in the archive.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodcoder666%2Fkatac4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodcoder666%2Fkatac4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodcoder666%2Fkatac4/lists"}