Board Game Reinforcement Learning ที่อ้างอิงจาก AlphaZero ของ Deepmind

เกม

วิธีใช้งาน

ความต้องการ

Setup

pip install -r requirements.txt

ลองเล่นกับ pretrained model

python run.py arena makhos human mcts,data/makhos/model-45k.h5,1000

สร้าง Model

python run.py newmodel <game> model.h5

Self-play

เล่นกับตัวเอง 5,000 เกม โดยแต่ละตาที่เดินมีการซิมมูเลชั่น 100 ครั้ง และเซฟข้อมูลเกมลงไฟล์ selfplay.txt

python run.py generate <game> --model model.h5 --simulation 100 -n 5000 --file selfplay.txt --progress

Training

ทำการเทรนโมเดล model.h5 ด้วยไฟล์ข้อมูล selfplay.txt จำนวน 3 epochs และเซฟใส่ newmodel.h5

python run.py train <game> selfplay.txt model.h5 newmodel.h5 --epoch 3 --progress

ทดสอบ

python run.py arena <game> <player1> <player2>

โดยที่