[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Zeta36--chess-alpha-zero":3,"tool-Zeta36--chess-alpha-zero":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",144730,2,"2026-04-07T23:26:32",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":76,"owner_location":77,"owner_email":76,"owner_twitter":76,"owner_website":78,"owner_url":79,"languages":80,"stars":93,"forks":94,"last_commit_at":95,"license":96,"difficulty_score":10,"env_os":97,"env_gpu":98,"env_ram":99,"env_deps":100,"category_tags":106,"github_topics":107,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":113,"updated_at":114,"faqs":115,"releases":145},5271,"Zeta36\u002Fchess-alpha-zero","chess-alpha-zero","Chess reinforcement learning by AlphaGo Zero methods.","chess-alpha-zero 是一个基于 AlphaGo Zero 算法理念的国际象棋强化学习开源项目。它旨在让 AI 从零开始，不依赖人类棋谱知识，仅通过自我对弈来掌握国际象棋策略，从而复现 DeepMind 在棋类游戏中的突破性成果。\n\n该项目主要解决了如何在通用框架下训练智能体理解复杂棋局的问题。虽然完全依靠单机进行大规模自我对弈成本较高，但 chess-alpha-zero 创新性地引入了监督学习流程，允许开发者利用现有的 PGN 人类棋谱数据预训练模型。这一改进显著降低了入门门槛，使模型在较少迭代次数下即可学会开局策略并避免低级失误，展现出约 1200 至 2000 分的棋力水平。\n\nchess-alpha-zero 非常适合对深度学习、强化学习及博弈论感兴趣的研究人员和开发者使用。项目基于 Python、TensorFlow 和 Keras 构建，代码结构清晰，并提供了可在线运行的演示笔记本，便于用户快速上手实验。其核心技术亮点在于结合了蒙特卡洛树搜索（MCTS）与残差神经网络，且具备良好的扩展性——随着计算资源的增加，其棋力表现能显著提升。对于希望探索分布式训练或参与","chess-alpha-zero 是一个基于 AlphaGo Zero 算法理念的国际象棋强化学习开源项目。它旨在让 AI 从零开始，不依赖人类棋谱知识，仅通过自我对弈来掌握国际象棋策略，从而复现 DeepMind 在棋类游戏中的突破性成果。\n\n该项目主要解决了如何在通用框架下训练智能体理解复杂棋局的问题。虽然完全依靠单机进行大规模自我对弈成本较高，但 chess-alpha-zero 创新性地引入了监督学习流程，允许开发者利用现有的 PGN 人类棋谱数据预训练模型。这一改进显著降低了入门门槛，使模型在较少迭代次数下即可学会开局策略并避免低级失误，展现出约 1200 至 2000 分的棋力水平。\n\nchess-alpha-zero 非常适合对深度学习、强化学习及博弈论感兴趣的研究人员和开发者使用。项目基于 Python、TensorFlow 和 Keras 构建，代码结构清晰，并提供了可在线运行的演示笔记本，便于用户快速上手实验。其核心技术亮点在于结合了蒙特卡洛树搜索（MCTS）与残差神经网络，且具备良好的扩展性——随着计算资源的增加，其棋力表现能显著提升。对于希望探索分布式训练或参与社区协作以挑战顶级引擎的用户，该项目也是一个重要的技术跳板。","[![Binder](https:\u002F\u002Fmybinder.org\u002Fbadge.svg)](https:\u002F\u002Fmybinder.org\u002Fv2\u002Fgh\u002Fkmader\u002Fchess-alpha-zero\u002Fmaster?urlpath=lab)\n[![Demo Notebook](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flaunch-demo_notebook-red.svg)](https:\u002F\u002Fmybinder.org\u002Fv2\u002Fgh\u002Fkmader\u002Fchess-alpha-zero\u002Fmaster?filepath=notebooks%2Fdemo.ipynb)\n\nAbout\n=====\n\nChess reinforcement learning by [AlphaGo Zero](https:\u002F\u002Fdeepmind.com\u002Fblog\u002Falphago-zero-learning-scratch\u002F) methods.\n\nThis project is based on these main resources:\n1) DeepMind's Oct 19th publication: [Mastering the Game of Go without Human Knowledge](https:\u002F\u002Fwww.nature.com\u002Farticles\u002Fnature24270.epdf?author_access_token=VJXbVjaSHxFoctQQ4p2k4tRgN0jAjWel9jnR3ZoTv0PVW4gB86EEpGqTRDtpIz-2rmo8-KG06gqVobU5NSCFeHILHcVFUeMsbvwS-lxjqQGg98faovwjxeTUgZAUMnRQ).\n2) The \u003Cb>great\u003C\u002Fb> Reversi development of the DeepMind ideas that @mokemokechicken did in his repo: https:\u002F\u002Fgithub.com\u002Fmokemokechicken\u002Freversi-alpha-zero\n3) DeepMind just released a new version of AlphaGo Zero (named now AlphaZero) where they master chess from scratch:\nhttps:\u002F\u002Farxiv.org\u002Fpdf\u002F1712.01815.pdf. In fact, in chess AlphaZero outperformed Stockfish after just 4 hours (300k steps) Wow!\n\nSee the [wiki](https:\u002F\u002Fgithub.com\u002FAkababa\u002FChess-Zero\u002Fwiki) for more details.\n\nNote\n----\n\nI'm the creator of this repo. I (and some others collaborators did our best: https:\u002F\u002Fgithub.com\u002FZeta36\u002Fchess-alpha-zero\u002Fgraphs\u002Fcontributors) but we found the self-play is too much costed for an only machine. Supervised learning worked fine but we never try the self-play by itself.\n\nAnyway I want to mention we have moved to a new repo where lot of people is working in a distributed version of AZ for chess (MCTS in C++): https:\u002F\u002Fgithub.com\u002Fglinscott\u002Fleela-chess\n\nProject is almost done and everybody will be able to participate just by executing a pre-compiled windows (or Linux) application. A really great job and effort has been done is this project and I'm pretty sure we'll be able to simulate the DeepMind results in not too long time of distributed cooperation.\n\nSo, I ask everybody that wish to see a UCI engine running a neural network to beat Stockfish go into that repo and help with his machine power.\n\nEnvironment\n-----------\n\n* Python 3.6.3\n* tensorflow-gpu: 1.3.0\n* Keras: 2.0.8\n\n### New results (after a great number of modifications due to @Akababa)\n\nUsing supervised learning on about 10k games, I trained a model (7 residual blocks of 256 filters) to a guesstimate of 1200 elo with 1200 sims\u002Fmove. One of the strengths of MCTS is it scales quite well with computing power.\n\nHere you can see an example where I (black) played against the model in the repo (white):\n\n![img](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_readme_06ba1c8e75da.gif)\n\nHere you can see an example of a game where I (white, ~2000 elo) played against the model in this repo (black):\n\n![img](https:\u002F\u002Fuser-images.githubusercontent.com\u002F4205182\u002F34323276-ecd2a7b6-e806-11e7-856a-4e2394bd75df.gif)\n\n### First \"good\" results\n\nUsing the new supervised learning step I created, I've been able to train a model to the point that seems to be learning the openings of chess. Also it seems the model starts to avoid losing naively pieces.\n\nHere you can see an example of a game played for me against this model (AI plays black):\n\n![partida1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_readme_9a079058834e.gif)\n\nHere we have a game trained by @bame55 (AI plays white):\n\n![partida3](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_readme_3d033dc93d5b.gif)\n\nThis model plays in this way after only 5 epoch iterations of the 'opt' worker, the 'eval' worker changed 4 times the best model (4 of 5). At this moment the loss of the 'opt' worker is 5.1 (and still seems to be converging very well).\n\nModules\n-------\n\n### Supervised Learning\n\nI've done a supervised learning new pipeline step (to use those human games files \"PGN\" we can find in internet as play-data generator).\nThis SL step was also used in the first and original version of AlphaGo and maybe chess is a some complex game that we have to pre-train first the policy model before starting the self-play process (i.e., maybe chess is too much complicated for a self training alone).\n\nTo use the new SL process is as simple as running in the beginning instead of the worker \"self\" the new worker \"sl\".\nOnce the model converges enough with SL play-data we just stop the worker \"sl\" and start the worker \"self\" so the model will start improving now due to self-play data.\n\n```bash\npython src\u002Fchess_zero\u002Frun.py sl\n```\nIf you want to use this new SL step you will have to download big PGN files (chess files) and paste them into the `data\u002Fplay_data` folder ([FICS](http:\u002F\u002Fficsgames.org\u002Fdownload.html) is a good source of data). You can also use the [SCID program](http:\u002F\u002Fscid.sourceforge.net\u002F) to filter by headers like player ELO, game result and more.\n\n**To avoid overfitting, I recommend using data sets of at least 3000 games and running at most 3-4 epochs.**\n\n### Reinforcement Learning\n\nThis AlphaGo Zero implementation consists of three workers: `self`, `opt` and `eval`.\n\n* `self` is Self-Play to generate training data by self-play using BestModel.\n* `opt` is Trainer to train model, and generate next-generation models.\n* `eval` is Evaluator to evaluate whether the next-generation model is better than BestModel. If better, replace BestModel.\n\n\n### Distributed Training\n\nNow it's possible to train the model in a distributed way. The only thing needed is to use the new parameter:\n\n* `--type distributed`: use mini config for testing, (see `src\u002Fchess_zero\u002Fconfigs\u002Fdistributed.py`)\n\nSo, in order to contribute to the distributed team you just need to run the three workers locally like this:\n\n```bash\npython src\u002Fchess_zero\u002Frun.py self --type distributed (or python src\u002Fchess_zero\u002Frun.py sl --type distributed)\npython src\u002Fchess_zero\u002Frun.py opt --type distributed\npython src\u002Fchess_zero\u002Frun.py eval --type distributed\n```\n\n### GUI\n* `uci` launches the Universal Chess Interface, for use in a GUI.\n\nTo set up ChessZero with a GUI, point it to `C0uci.bat` (or rename to .sh).\nFor example, this is screenshot of the random model using Arena's self-play feature:\n![capture](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_readme_25c598ea3004.png)\n\nData\n-----\n\n* `data\u002Fmodel\u002Fmodel_best_*`: BestModel.\n* `data\u002Fmodel\u002Fnext_generation\u002F*`: next-generation models.\n* `data\u002Fplay_data\u002Fplay_*.json`: generated training data.\n* `logs\u002Fmain.log`: log file.\n\nIf you want to train the model from the beginning, delete the above directories.\n\nHow to use\n==========\n\nSetup\n-------\n### install libraries\n```bash\npip install -r requirements.txt\n```\n\nIf you want to use GPU, follow [these instructions](https:\u002F\u002Fwww.tensorflow.org\u002Finstall\u002F) to install with pip3.\n\nMake sure Keras is using Tensorflow and you have Python 3.6.3+. Depending on your environment, you may have to run python3\u002Fpip3 instead of python\u002Fpip.\n\n\nBasic Usage\n------------\n\nFor training model, execute `Self-Play`, `Trainer` and `Evaluator`.\n\n**Note**: Make sure you are running the scripts from the top-level directory of this repo, i.e. `python src\u002Fchess_zero\u002Frun.py opt`, not `python run.py opt`.\n\n\nSelf-Play\n--------\n\n```bash\npython src\u002Fchess_zero\u002Frun.py self\n```\n\nWhen executed, Self-Play will start using BestModel.\nIf the BestModel does not exist, new random model will be created and become BestModel.\n\n### options\n* `--new`: create new BestModel\n* `--type mini`: use mini config for testing, (see `src\u002Fchess_zero\u002Fconfigs\u002Fmini.py`)\n\nTrainer\n-------\n\n```bash\npython src\u002Fchess_zero\u002Frun.py opt\n```\n\nWhen executed, Training will start.\nA base model will be loaded from latest saved next-generation model. If not existed, BestModel is used.\nTrained model will be saved every epoch.\n\n### options\n* `--type mini`: use mini config for testing, (see `src\u002Fchess_zero\u002Fconfigs\u002Fmini.py`)\n* `--total-step`: specify total step(mini-batch) numbers. The total step affects learning rate of training.\n\nEvaluator\n---------\n\n```bash\npython src\u002Fchess_zero\u002Frun.py eval\n```\n\nWhen executed, Evaluation will start.\nIt evaluates BestModel and the latest next-generation model by playing about 200 games.\nIf next-generation model wins, it becomes BestModel.\n\n### options\n* `--type mini`: use mini config for testing, (see `src\u002Fchess_zero\u002Fconfigs\u002Fmini.py`)\n\n\nTips and Memory\n====\n\nGPU Memory\n----------\n\nUsually the lack of memory cause warnings, not error.\nIf error happens, try to change `vram_frac` in `src\u002Fconfigs\u002Fmini.py`,\n\n```python\nself.vram_frac = 1.0\n```\n\nSmaller batch_size will reduce memory usage of `opt`.\nTry to change `TrainerConfig#batch_size` in `MiniConfig`.\n","[![Binder](https:\u002F\u002Fmybinder.org\u002Fbadge.svg)](https:\u002F\u002Fmybinder.org\u002Fv2\u002Fgh\u002Fkmader\u002Fchess-alpha-zero\u002Fmaster?urlpath=lab)\n[![Demo Notebook](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flaunch-demo_notebook-red.svg)](https:\u002F\u002Fmybinder.org\u002Fv2\u002Fgh\u002Fkmader\u002Fchess-alpha-zero\u002Fmaster?filepath=notebooks%2Fdemo.ipynb)\n\n简介\n=====\n\n基于[AlphaGo Zero](https:\u002F\u002Fdeepmind.com\u002Fblog\u002Falphago-zero-learning-scratch\u002F)方法的国际象棋强化学习。\n\n该项目主要参考了以下资源：\n1) DeepMind于2017年10月19日发表的论文：《无需人类知识即可掌握围棋》（https:\u002F\u002Fwww.nature.com\u002Farticles\u002Fnature24270.epdf?author_access_token=VJXbVjaSHxFoctQQ4p2k4tRgN0jAjWel9jnR3ZoTv0PVW4gB86EEpGqTRDtpIz-2rmo8-KG06gqVobU5NSCFeHILHcVFUeMsbvwS-lxjqQGg98faovwjxeTUgZAUMnRQ）。\n2) @mokemokechicken在其仓库中对DeepMind思想进行的精彩实现：https:\u002F\u002Fgithub.com\u002Fmokemokechicken\u002Freversi-alpha-zero。\n3) DeepMind最近发布了AlphaGo Zero的新版本（现称为AlphaZero），该版本从零开始掌握了国际象棋：\nhttps:\u002F\u002Farxiv.org\u002Fpdf\u002F1712.01815.pdf。事实上，在国际象棋领域，AlphaZero仅用4小时（30万步）就超越了Stockfish！太惊人了！\n\n更多详情请参阅[wiki](https:\u002F\u002Fgithub.com\u002FAkababa\u002FChess-Zero\u002Fwiki)。\n\n注\n----\n\n我是这个仓库的创建者。我和一些合作者尽了最大努力（https:\u002F\u002Fgithub.com\u002FZeta36\u002Fchess-alpha-zero\u002Fgraphs\u002Fcontributors），但发现单机进行自我对弈的成本实在太高。监督学习效果不错，但我们从未单独尝试过自我对弈。\n\n无论如何，我想提一下，我们已经迁移到一个新的仓库，那里有许多人正在开发分布式版的AZ国际象棋引擎（使用C++实现的蒙特卡洛树搜索）：https:\u002F\u002Fgithub.com\u002Fglinscott\u002Fleela-chess。\n\n项目已接近完成，每个人只需运行一个预编译好的Windows或Linux应用程序即可参与。在这个项目中大家付出了巨大的努力，我相信通过分布式协作，我们很快就能复现DeepMind的研究成果。\n\n因此，我呼吁所有希望看到能够击败Stockfish的神经网络UCI引擎的人，前往那个仓库并贡献自己的计算资源。\n\n环境\n-----------\n\n* Python 3.6.3\n* tensorflow-gpu: 1.3.0\n* Keras: 2.0.8\n\n### 新结果（在@Akababa大量修改后）\n\n通过使用约1万盘棋局的监督学习数据，我训练了一个包含7个残差块、每块256个滤波器的模型，其大致 Elo 等级为1200，每次走棋进行1200次模拟。MCTS 的一大优势在于它能很好地随着计算能力的提升而扩展。\n\n这里是一个例子：我执黑与仓库中的模型（白方）对弈：\n\n![img](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_readme_06ba1c8e75da.gif)\n\n这里又是一个例子：我执白（Elo 约2000）与本仓库中的模型（黑方）对弈：\n\n![img](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_readme_86ed347f342e.gif)\n\n### 初步“良好”结果\n\n借助我新创建的监督学习步骤，我已经能够训练出一个似乎正在学习国际象棋开局策略的模型。此外，该模型也开始避免轻易丢子。\n\n这里是我与该模型（AI执黑）对弈的一盘棋：\n\n![partida1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_readme_9a079058834e.gif)\n\n接下来是一盘由@bame55训练的棋局（AI执白）：\n\n![partida3](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_readme_3d033dc93d5b.gif)\n\n这台模型仅经过‘opt’工作进程5轮迭代后，‘eval’工作进程就已更换了4次最佳模型（总共5次中有4次）。目前‘opt’工作进程的损失值为5.1，并且仍在持续收敛。\n\n模块\n-------\n\n### 监督学习\n\n我设计了一套新的监督学习流程，用于将互联网上可获得的PGN格式棋谱文件作为训练数据源。\n这种监督学习方法也曾被最初的AlphaGo所采用。或许国际象棋是一项较为复杂的棋类游戏，我们需要先对策略模型进行预训练，然后再启动自我对弈过程——也就是说，单独依靠自我训练可能对国际象棋来说过于复杂。\n\n要使用这套新的SL流程，只需在启动时将原本的“self”工作进程替换为“sl”工作进程即可。\n当模型通过SL训练数据达到足够收敛后，停止“sl”工作进程，再启动“self”工作进程，这样模型就可以开始利用自我对弈产生的数据进一步优化自身。\n\n```bash\npython src\u002Fchess_zero\u002Frun.py sl\n```\n若要使用这一新的SL步骤，你需要下载大量的PGN格式棋谱文件，并将其放入`data\u002Fplay_data`目录中。（例如，http:\u002F\u002Fficsgames.org\u002Fdownload.html 是一个不错的数据来源。）你还可以使用SCID软件，按选手ELO等级、比赛结果等条件筛选棋谱。\n\n**为避免过拟合，建议使用至少3000盘棋谱的数据集，并且最多运行3–4轮迭代。**\n\n### 强化学习\n\n本AlphaGo Zero实现包含三个工作进程：`self`、`opt`和`eval`。\n\n* `self`负责自我对弈，利用当前最佳模型生成训练数据。\n* `opt`是训练师，负责训练模型并生成下一代模型。\n* `eval`是评估师，用于判断下一代模型是否优于当前的最佳模型。如果更好，则替换当前的最佳模型。\n\n### 分布式训练\n\n现在可以以分布式方式训练模型。只需使用以下新参数：\n\n* `--type distributed`：用于测试的迷你配置（参见`src\u002Fchess_zero\u002Fconfigs\u002Fdistributed.py`）。\n\n因此，若想为分布式团队贡献力量，只需在本地运行以下三个工作进程：\n\n```bash\npython src\u002Fchess_zero\u002Frun.py self --type distributed （或 python src\u002Fchess_zero\u002Frun.py sl --type distributed）\npython src\u002Fchess_zero\u002Frun.py opt --type distributed\npython src\u002Fchess_zero\u002Frun.py eval --type distributed\n```\n\n### GUI\n* `uci`会启动通用国际象棋接口，以便在GUI中使用。\n\n要将ChessZero与GUI配合使用，只需指向`C0uci.bat`文件（或将其重命名为`.sh`文件）。\n例如，下图展示了随机模型利用Arena软件的自我对弈功能时的界面截图：\n![capture](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_readme_25c598ea3004.png)\n\n数据\n-----\n\n* `data\u002Fmodel\u002Fmodel_best_*`：当前最佳模型。\n* `data\u002Fmodel\u002Fnext_generation\u002F*`：下一代模型。\n* `data\u002Fplay_data\u002Fplay_*.json`：生成的训练数据。\n* `logs\u002Fmain.log`：日志文件。\n\n若要从头开始训练模型，请删除上述目录。\n\n使用方法\n==========\n\n设置\n-------\n\n### 安装依赖库\n```bash\npip install -r requirements.txt\n```\n\n如果需要使用 GPU，请按照 [这些说明](https:\u002F\u002Fwww.tensorflow.org\u002Finstall\u002F) 使用 pip3 进行安装。\n\n请确保 Keras 使用的是 TensorFlow，并且 Python 版本为 3.6.3 或更高。根据你的环境，可能需要使用 `python3`\u002F`pip3` 而不是 `python`\u002F`pip`。\n\n\n基本用法\n------------\n\n训练模型时，依次执行 `Self-Play`、`Trainer` 和 `Evaluator`。\n\n**注意**：请确保从本仓库的顶级目录运行脚本，即 `python src\u002Fchess_zero\u002Frun.py opt`，而不是 `python run.py opt`。\n\n\nSelf-Play\n--------\n\n```bash\npython src\u002Fchess_zero\u002Frun.py self\n```\n\n执行时，Self-Play 将会使用 BestModel 开始对局。如果 BestModel 不存在，则会创建一个新的随机模型并将其设为 BestModel。\n\n### 参数选项\n* `--new`: 创建一个新的 BestModel\n* `--type mini`: 使用 mini 配置进行测试（参见 `src\u002Fchess_zero\u002Fconfigs\u002Fmini.py`）\n\n\nTrainer\n-------\n\n```bash\npython src\u002Fchess_zero\u002Frun.py opt\n```\n\n执行时，训练将开始。基础模型将从最近保存的下一代模型中加载；如果不存在，则使用 BestModel。每完成一个 epoch，训练后的模型都会被保存。\n\n### 参数选项\n* `--type mini`: 使用 mini 配置进行测试（参见 `src\u002Fchess_zero\u002Fconfigs\u002Fmini.py`）\n* `--total-step`: 指定总的步数（mini-batch 数量）。总步数会影响训练的学习率。\n\n\nEvaluator\n---------\n\n```bash\npython src\u002Fchess_zero\u002Frun.py eval\n```\n\n执行时，评估将开始。它会通过大约 200 局对局来评估 BestModel 和最新的下一代模型。如果下一代模型获胜，则其将成为 BestModel。\n\n### 参数选项\n* `--type mini`: 使用 mini 配置进行测试（参见 `src\u002Fchess_zero\u002Fconfigs\u002Fmini.py`）\n\n\n提示与内存管理\n====\n\nGPU 内存\n----------\n\n通常情况下，内存不足会导致警告而非错误。如果出现错误，请尝试修改 `src\u002Fconfigs\u002Fmini.py` 中的 `vram_frac`：\n\n```python\nself.vram_frac = 1.0\n```\n\n减小 batch_size 可以降低 `opt` 的内存占用。可以尝试调整 `MiniConfig` 中的 `TrainerConfig#batch_size`。","# Chess-Alpha-Zero 快速上手指南\n\nChess-Alpha-Zero 是一个基于 AlphaGo Zero 算法的国际象棋强化学习开源项目。它通过自我对弈（Self-Play）和监督学习（Supervised Learning）训练神经网络模型，旨在不依赖人类先验知识的情况下掌握国际象棋。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**: Linux 或 Windows (推荐 Linux)\n*   **Python 版本**: 3.6.3 或更高版本\n*   **深度学习框架**:\n    *   TensorFlow-GPU: 1.3.0 (如需使用 GPU 加速)\n    *   Keras: 2.0.8\n*   **硬件建议**: 虽然可以在 CPU 上运行，但训练过程计算量巨大，强烈建议使用 NVIDIA GPU。\n\n> **注意**：本项目依赖较旧版本的 TensorFlow 和 Keras。如果您遇到兼容性问题，建议创建独立的 Python 虚拟环境。\n\n## 安装步骤\n\n1.  **克隆仓库**\n    首先将代码克隆到本地：\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fkmader\u002Fchess-alpha-zero.git\n    cd chess-alpha-zero\n    ```\n\n2.  **安装依赖**\n    使用 pip 安装所需库。国内用户推荐使用清华源或阿里源以加速下载：\n    ```bash\n    # 使用默认源\n    pip install -r requirements.txt\n\n    # 或使用国内镜像源（推荐）\n    pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    ```\n\n3.  **配置 GPU (可选)**\n    如果您计划使用 GPU 进行训练，请确保已按照 [TensorFlow 官方指南](https:\u002F\u002Fwww.tensorflow.org\u002Finstall\u002F) 正确安装了 `tensorflow-gpu`。\n    验证 Keras 是否正在使用 TensorFlow 后端，并确认 Python 版本符合要求。在某些环境中，可能需要使用 `python3` 和 `pip3` 命令。\n\n## 基本使用\n\n本项目的核心流程包含三个主要工作进程：**自我对弈 (self)**、**训练 (opt)** 和 **评估 (eval)**。\n\n> **重要提示**：所有命令必须在仓库的**根目录**下执行。\n> 正确示例：`python src\u002Fchess_zero\u002Frun.py opt`\n> 错误示例：`python run.py opt` (不要在 src 目录下直接运行)\n\n### 1. 启动自我对弈 (Self-Play)\n该进程使用当前最佳模型（BestModel）进行自我对弈，生成训练数据。如果不存在最佳模型，系统将自动创建一个随机模型作为初始最佳模型。\n\n```bash\npython src\u002Fchess_zero\u002Frun.py self\n```\n\n*   `--new`: 强制创建一个新的随机最佳模型。\n*   `--type mini`: 使用迷你配置文件进行测试（详见 `src\u002Fchess_zero\u002Fconfigs\u002Fmini.py`），适合快速验证环境。\n\n### 2. 启动训练器 (Trainer)\n该进程读取自我对弈生成的数据，训练神经网络并生成下一代模型。\n\n```bash\npython src\u002Fchess_zero\u002Frun.py opt\n```\n\n*   系统会自动加载最新保存的下一代模型作为基础；若不存在，则使用最佳模型。\n*   训练后的模型会在每个 epoch 结束后保存。\n*   `--total-step`: 指定总的训练步数（mini-batch 数量），这将影响学习率。\n\n### 3. 启动评估器 (Evaluator)\n该进程通过让“最佳模型”与“最新一代模型”进行约 200 局对弈来评估性能。如果新一代模型获胜，它将取代当前的最佳模型。\n\n```bash\npython src\u002Fchess_zero\u002Frun.py eval\n```\n\n### 进阶：使用监督学习预训练 (可选)\n由于国际象棋复杂度较高，纯自我对弈收敛较慢。项目支持使用人类棋谱（PGN 文件）进行监督学习预训练。\n\n1.  下载大量 PGN 棋谱文件（例如来自 [FICS](http:\u002F\u002Fficsgames.org\u002Fdownload.html)），放入 `data\u002Fplay_data` 文件夹。\n2.  运行监督学习进程：\n    ```bash\n    python src\u002Fchess_zero\u002Frun.py sl\n    ```\n3.  待模型收敛后，停止 `sl` 进程，转而运行 `self` 进程开始自我对弈强化。\n\n### 对接图形界面 (GUI)\n您可以将训练好的模型作为 UCI 引擎接入任何国际象棋 GUI（如 Arena, ChessBase 等）。\n\n*   运行 UCI 接口：\n    ```bash\n    python src\u002Fchess_zero\u002Frun.py uci\n    ```\n*   在 GUI 软件中，将引擎路径指向项目根目录下的 `C0uci.bat` (Windows) 或对应的 shell 脚本。\n\n### 分布式训练\n若有多台机器协作，可添加 `--type distributed` 参数分别在三台机器（或同一机器的不同终端）上运行上述三个进程：\n\n```bash\npython src\u002Fchess_zero\u002Frun.py self --type distributed\npython src\u002Fchess_zero\u002Frun.py opt --type distributed\npython src\u002Fchess_zero\u002Frun.py eval --type distributed\n```\n\n## 显存优化提示\n\n如果在运行过程中遇到显存不足（OOM）导致的错误或警告：\n\n1.  修改 `src\u002Fchess_zero\u002Fconfigs\u002Fmini.py` (或您使用的配置文件)，减小 `vram_frac` 的值：\n    ```python\n    self.vram_frac = 0.5  # 尝试降低此比例，默认为 1.0\n    ```\n2.  减小训练器的 `batch_size` 配置项，以降低 `opt` 进程的显存占用。","一位独立开发者希望在不依赖昂贵集群的情况下，从零开始训练一个能理解国际象棋开局并避免低级失误的自定义 AI 引擎。\n\n### 没有 chess-alpha-zero 时\n- **数据依赖性强**：必须手动收集并清洗海量人类对局数据（PGN 文件）进行监督学习，否则模型无法掌握基本棋理。\n- **开发门槛极高**：复现 DeepMind 的 AlphaGo Zero 算法需要从头编写复杂的蒙特卡洛树搜索（MCTS）与神经网络交互逻辑，极易出错。\n- **训练效果不可控**：缺乏成熟的残差网络架构参考，模型往往难以收敛，经常走出“送子”等低级错误，无法达到业余选手水平。\n- **资源利用率低**：单机难以支撑纯自我博弈（Self-play）的巨大算力消耗，导致实验周期漫长且容易中途放弃。\n\n### 使用 chess-alpha-zero 后\n- **快速冷启动**：直接利用内置的监督学习流水线导入公开的人类对局数据，仅需约 1 万局数据即可让模型初步掌握开局策略。\n- **架构开箱即用**：基于成熟的 Keras 与 TensorFlow 实现，预置了 7 层残差块等高效网络结构，大幅降低算法复现难度。\n- **棋力显著跃升**：经过少量迭代训练，模型不仅能避免 naive 的丢子失误，在每秒 1200 次模拟下还能达到约 1200 ELO 的业余段位。\n- **灵活扩展路径**：提供了清晰的模块划分，开发者可先通过监督学习验证模型，再逐步过渡到分布式自我博弈以追求更高棋力。\n\nchess-alpha-zero 将顶尖的强化学习理论转化为可执行的代码框架，让个人开发者也能在单机上低成本构建具备进化潜力的国际象棋 AI。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FZeta36_chess-alpha-zero_06ba1c8e.gif","Zeta36","Samuel","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FZeta36_4ba2c101.jpg",null,"Spain","http:\u002F\u002Fquevidaesta2010.blogspot.com\u002F","https:\u002F\u002Fgithub.com\u002FZeta36",[81,85,89],{"name":82,"color":83,"percentage":84},"Jupyter Notebook","#DA5B0B",76.5,{"name":86,"color":87,"percentage":88},"Python","#3572A5",23.5,{"name":90,"color":91,"percentage":92},"Batchfile","#C1F12E",0,2213,480,"2026-04-07T18:10:35","MIT","Windows, Linux","需要 NVIDIA GPU (基于 tensorflow-gpu)，具体型号和显存大小未说明，但提示可通过调整配置减少显存占用","未说明",{"notes":101,"python":102,"dependencies":103},"该项目主要使用监督学习（SL）预训练模型，因为单机自博弈成本过高。若使用 GPU 需参考 TensorFlow 官方安装指南配置 CUDA 环境。可通过修改配置文件中的 vram_frac 参数或减小 batch_size 来缓解显存不足的问题。训练数据需自行下载 PGN 文件并放入指定目录。","3.6.3+",[104,105],"tensorflow-gpu==1.3.0","Keras==2.0.8",[14],[108,109,110,111,112],"reinforcement-learning","keras","alphago-zero","tensorflow","chess","2026-03-27T02:49:30.150509","2026-04-08T07:44:50.366883",[116,121,126,131,136,141],{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},23893,"运行 AlphaZero 时遇到 'OSError: Unable to open file (File signature not found)' 错误怎么办？","该错误通常发生在分布式模式（--type distributed）下，导致模型权重文件（model_best_weight.h5）损坏或大小为 0。解决方法是：1. 尝试不使用分布式选项运行，即执行 `python src\\chess_zero\\run.py self` 而不是 `... self --type distributed`。2. 如果已发生错误，请删除 model 目录下的 `model_best_config.json` 和 `model_best_weight.h5` 文件，然后重新运行命令以生成新的模型文件。","https:\u002F\u002Fgithub.com\u002FZeta36\u002Fchess-alpha-zero\u002Fissues\u002F55",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},23894,"如何将后端从 TensorFlow 替换为 Microsoft CNTK？","由于项目基于 Keras，可以通过修改 Keras 配置文件轻松切换后端。步骤如下：1. 安装 CNTK（例如版本 2.4）。2. 找到并编辑 `.keras\u002Fkeras.json` 文件。3. 将文件中的 \"backend\" 值从 \"tensorflow\" 改为 \"cntk\"。保存后重新运行程序即可。注意：在某些测试中，CNTK 的训练速度可能慢于 TensorFlow，但推理速度相近。","https:\u002F\u002Fgithub.com\u002FZeta36\u002Fchess-alpha-zero\u002Fissues\u002F62",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},23895,"如何获取用于训练的高质量棋局数据（特别是具有物质优势差异的棋局）？","可以使用 SCID (Chess Database) 软件（如版本 4.6.5）来筛选数据。具体步骤：1. 在 SCID 中使用 'Search' 和 'Material' 菜单功能。2. 设置筛选条件，例如选择物质差异（material difference）至少为 10 或 4 的棋局。3. 创建一个新的空数据库，将筛选出的棋局复制进去。4. 使用数据库导出功能将棋局导出为 PGN 格式。也可以使用其他工具如 pgnextract 进行类似操作。","https:\u002F\u002Fgithub.com\u002FZeta36\u002Fchess-alpha-zero\u002Fissues\u002F77",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},23896,"日志输出中变量未被替换（显示为 {config_path} 等占位符）如何解决？","这是因为代码使用了 Python 3.6+ 的 f-string 格式化语法，但运行环境可能未正确识别或版本过低。解决方法：1. 确保使用 Python 3.6 或更高版本运行。2. 如果需要兼容旧版本 Python，可以将代码中的 f-string（如 `f\"text {var}\"`）改写为 `.format()` 方法（如 `\"text {}\".format(var)`）或百分号格式化。维护者已确认项目中应全面使用 'f' 前缀，若发现遗漏可手动添加。","https:\u002F\u002Fgithub.com\u002FZeta36\u002Fchess-alpha-zero\u002Fissues\u002F22",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},23897,"神经网络输入中是否需要包含移动历史（Move History）？","根据广泛测试，对于此类国际象棋 AI，向神经网络输入额外的移动历史（如 8 步半移动）、三次重复局面标记或第 50 步规则计数，并不能显著提升性能，甚至可能因增加噪声而降低约 18 Elo 分数。网络更倾向于直接从当前棋盘位置中学习，具体的重复判定和规则处理应由搜索代码（Search Code）而非神经网络本身负责。因此，建议仅使用当前棋盘状态作为输入。","https:\u002F\u002Fgithub.com\u002FZeta36\u002Fchess-alpha-zero\u002Fissues\u002F67",{"id":142,"question_zh":143,"answer_zh":144,"source_url":130},23898,"上传的模型配置文件与仓库中的默认配置不一致，该如何确定正确的网络结构？","仓库中默认的 \"mini\" 配置通常是第一层 5 个滤波器，网络结构为 256x7。上传的最佳权重文件可能是在本地修改过配置后训练的。要确认具体使用的网络维度，最直接的方法是查看与该权重文件配套的 `.json` 配置文件，其中会记录实际的网络尺寸参数。如果是从头开始训练，较小的网络结构通常在初期收敛更快。",[]]