This repository has been archived by the owner on Jun 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
RunAll.py
executable file
·62 lines (56 loc) · 2.52 KB
/
RunAll.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!python
# All script can be called at once from here
import multiprocessing
import Networks
import Modes
# Running options
cpu = max(multiprocessing.cpu_count() - 1, 1) # The number of cpu the scripts will use. I always leave 1 free so I can still use my computer
# I recommend to leave at least 1 cpu free so you can still work on your computer
shuffling_files = 89 # prime number to maximize spreading. Take a prime higher to the number of data files to limit the file size
keep_for_testing = 7 # Number of files that will be kept for testing only. Increase this number as you get more files (10% is standard)
# Keep in mind testing on games that were not used for training is the only we can be sure the neural network is not recognizing games but has
# actually learned to predict the winner.
restore = False # leave this to False, or your model will overfit the data (it will recognize the game and not learn why the game is won/loss)
# Mode and Network
# Look at Modes.py and Networks.py to see the list of available modes/networks
# Feel free to build/tune your own networks
# BUT, keep in mind that more complex networks require more data and take more time to train.
m = Modes.ABR_TJMCS_Mode(['9.6','9.7','9.8'])
n = Networks.DenseUniform(mode=m, n_hidden_layers=5, NN=1024, dropout=0.2, batch_size=1000, report=1)
# Scripts to execute, comment useless ones
# In particular, if you just want to run the app, comment all but 'BestPicks'
to_execute = [
'PlayersListing',
'DataDownloader', # runs on multiple cpu
'DataExtractor', # runs on multiple cpu
'RoleUpdater',
'DataProcessing', # runs on multiple cpu
'DataShuffling', # runs on multiple cpu
'Learner', # runs on gpu
'BestPicks',
]
if __name__ == '__main__':
if 'PlayersListing' in to_execute:
import PlayersListing
PlayersListing.run(m)
if 'DataDownloader' in to_execute:
import DataDownloader
DataDownloader.run(m)
if 'DataExtractor' in to_execute:
import DataExtractor
DataExtractor.run(m, cpu)
if 'RoleUpdater' in to_execute:
import RoleUpdater
RoleUpdater.run(m)
if 'DataProcessing' in to_execute:
import DataProcessing
DataProcessing.run(m, cpu)
if 'DataShuffling' in to_execute:
import DataShuffling
DataShuffling.run(m, shuffling_files, keep_for_testing, cpu)
if 'Learner' in to_execute:
import Learner
Learner.run(m, n, restore)
if 'BestPicks' in to_execute:
import BestPicks
BestPicks.run(m, n)