{"id":16589963,"url":"https://github.com/rlch/ch0ss","last_synced_at":"2026-04-25T05:40:09.910Z","repository":{"id":131913473,"uuid":"326207624","full_name":"rlch/ch0ss","owner":"rlch","description":"A sad excuse for a Chess AI using a CNN value function and Minimax alpha-beta pruning","archived":false,"fork":false,"pushed_at":"2021-01-05T06:47:29.000Z","size":37112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-16T22:47:07.450Z","etag":null,"topics":["chess","chess-ai","chess-engine","cnn-classification","machine-learning","minimax-alpha-beta-pruning","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rlch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-01-02T15:07:44.000Z","updated_at":"2021-06-04T10:50:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"de8c1991-62bb-4e89-ac82-ad7683a5652a","html_url":"https://github.com/rlch/ch0ss","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fch0ss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fch0ss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fch0ss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fch0ss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rlch","download_url":"https://codeload.github.com/rlch/ch0ss/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242208369,"owners_count":20089723,"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","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":["chess","chess-ai","chess-engine","cnn-classification","machine-learning","minimax-alpha-beta-pruning","python3"],"created_at":"2024-10-11T23:10:34.029Z","updated_at":"2026-04-25T05:40:09.878Z","avatar_url":"https://github.com/rlch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ch0ss\n\n```\n          oooo          .oooo.\n          `888         d8P'`Y8b\n .ooooo.   888 .oo.   888    888  .oooo.o  .oooo.o\nd88' `\"Y8  888P\"Y88b  888    888 d88(  \"8 d88(  \"8\n888        888   888  888    888 `\"Y88b.  `\"Y88b.\n888   .o8  888   888  `88b  d88' o.  )88b o.  )88b\n`Y8bod8P' o888o o888o  `Y8bd8P'  8\"\"888P' 8\"\"888P'\n```\n\nA sad excuse for a Chess AI, written to justify spending more time on my hopeless addiction\n\n## Training Set\n\nTrained on the [KingBase2019](https://archive.org/details/KingBase2019) dataset (2.2m+ games of players with 2000+ ELO). Aggregated into one file with this scriptkiddie nonsense:\n\n```bash\n[ ! -f dataset.pgn ] \u0026\u0026 cat *.pgn | sed '/\\[.*\\]/d' | tr -s '\\n\\r' | uniq \u003e dataset.pgn || echo dont be greedy\n```\n\n## Value Function\n\nThe board state is valued by a fairly standard CNN. Feature extraction on the `n⨯6⨯8⨯8` design matrix is done through `Conv2D` layers, and classification through `Dense` layers to get a response in the range `[-1, 1]`. No pooling layers were used with the interest of retaining data - don't want the AI to end up with terrible board vision like me :upside_down_face: \n\n## Move Selection\n\nWith help from [python-chess](https://github.com/niklasf/python-chess) (getting valid moves + parsing PGNs), valid moves from a given position are searched using the minimax algorithm with alpha-beta pruning. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlch%2Fch0ss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frlch%2Fch0ss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlch%2Fch0ss/lists"}