Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
一心炼银 a0ca324231 | 1 year ago | |
---|---|---|
bgm | 1 year ago | |
imgs | 1 year ago | |
models | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 1 year ago | |
UIplay.py | 1 year ago | |
__init__.py | 1 year ago | |
collect.py | 1 year ago | |
config.py | 1 year ago | |
game.py | 1 year ago | |
mcts.py | 1 year ago | |
mcts_pure.py | 1 year ago | |
my_redis.py | 1 year ago | |
paddle_net.py | 1 year ago | |
play_with_ai.py | 1 year ago | |
pytorch_net.py | 1 year ago | |
train.py | 1 year ago | |
zip_array.py | 1 year ago |
collect.py 自我对弈用于数据收集
train.py 用于训练模型
game.py 实现象棋的逻辑
mcts.py 实现蒙特卡洛树搜索
paddle_net.py,pytorch_net.py 神经网络对走子进行评估
play_with_ai.py 人机对弈print版
UIplay.py GUI界面人机对弈
使用pytorch版本请设置config.py 中CONFIG['use_frame'] = 'pytorch',
使用pytorch版本请设置config.py 中CONFIG['use_frame'] = 'paddle'。
不管是使用哪个框架,都一定要安装gpu版本,而且要用英伟达显卡,因为我们蒙特卡洛一次走此要进行上千次的神经网络推理,所以必须要快!
训练时,在终端运行python collect.py用于自我对弈产生数据,这个可以多开。
然后,在终端运行python train.py用于模型训练,这个终端只用开一个。
B站视频链接:https://www.bilibili.com/video/BV183411g7GX
知乎文章:https://zhuanlan.zhihu.com/p/528824058?
aistudio上一键可运行项目:https://aistudio.baidu.com/aistudio/projectdetail/4215743 (可以使用免费的V100来进行训练)
本项目主要参考的资料如下,十分感谢大佬们的分享
1、程世东 https://zhuanlan.zhihu.com/p/34433581 (中国象棋cchesszero )
2、AI在打野 https://aistudio.baidu.com/aistudio/projectdetail/1403398 (用paddle打造的五子棋AI)
3、junxiaosong https://github.com/junxiaosong/AlphaZero_Gomoku (五子棋alphazero)
4、书籍:边做边学深度强化学习:PyTorch 程序设计实践
5、书籍:强化学习第二版
后续应该会对该AI继续训练下去,亲手造一个超强的下棋AI简直太酷了!
实现AlphaZero算法并用于中国象棋,训练100个对局的数据之后,模型就已学会使用棋子进行防守。想要打败电脑也不能掉以轻心。
Python
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》