-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.py
More file actions
34 lines (28 loc) · 770 Bytes
/
Copy pathtrain.py
File metadata and controls
34 lines (28 loc) · 770 Bytes
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
from Coach import Coach
from ut3.UT3Game import UT3Game as Game
from ut3.pytorch.NNet import NNetWrapper as nn
from utils import *
args = dotdict({
'numIters': 1000,
'numEps': 100,
'tempThreshold': 15,
'updateThreshold': 0.52,
'maxlenOfQueue': 200000,
'numMCTSSims': 25,
'arenaCompare': 40,
'cpuct': 2,
'checkpoint': './temp/',
'load_model': False,
'load_folder_file': ('./temp/','temp.pth.tar'),
'numItersForTrainExamplesHistory': 20,
})
if __name__=="__main__":
g = Game()
nnet = nn(g)
if args.load_model:
nnet.load_checkpoint(*args.load_folder_file)
c = Coach(g, nnet, args)
if args.load_model:
print("Load trainExamples from file")
c.loadTrainExamples()
c.learn()