forked from suragnair/alpha-zero-general
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.py
39 lines (36 loc) · 1.18 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from Coach import Coach
from othello.OthelloGame import OthelloGame as Game
from othello.tensorflow.NNet import NNetWrapper as nn
from utils import *
import os
"""
Before using multiprocessing, please check 2 things before use this script.
1. The number of PlayPool should not over your CPU's core number.
2. Make sure all Neural Network which each process created can store in VRAM at same time. Check your NN size before use this.
"""
args = dotdict({
'numIters': 1000,
'numEps': 100,
'tempThreshold': 15,
'updateThreshold': 0.6,
'maxlenOfQueue': 200000,
'numMCTSSims': 25,
'cpuct': 1,
'multiGPU': False,
'setGPU': '0',
# The total number of games when self-playing is:
# Total = numSelfPlayProcess * numPerProcessSelfPlay
'numSelfPlayProcess': 4,
'numPerProcessSelfPlay': 10,
# The total number of games when against-playing is:
# Total = numAgainstPlayProcess * numPerProcessAgainst
'numAgainstPlayProcess': 4,
'numPerProcessAgainst': 10,
'checkpoint': './temp/',
'numItersForTrainExamplesHistory': 20,
})
if __name__=="__main__":
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
g = Game(6)
c = Coach(g, args)
c.learn()