-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·52 lines (46 loc) · 1.83 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
40
41
42
43
44
45
46
47
48
49
50
51
52
import functions as f
import argparse
from argparse import RawTextHelpFormatter
from sys import argv
import warnings
import matplotlib.pyplot as plt
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
# f.synthetic_data_generator()
# train,test = f.data_loader()
# print("This is my file to test Python's execution methods.")
# print("The variable __name__ tells me which context this file is running in.")
# print("The value of __name__ is:", repr(__name__))
if __name__ == '__main__':
parser = argparse.ArgumentParser(usage='Chose one of the three modes: Demo, Model, Data',formatter_class=RawTextHelpFormatter)
parser.add_argument(
'-m','--mode',
help = '''Specify the mode that the program will run (Default = Demo)
\n\t Demo: Create the dataset and train a CNN classification model
\n\t Data: Create the test Dataset for the project
\n\t CNN : Create and Train a Deep Learning model and print the confusion matrix
\n\t HMM : Create and Train a Hiden Markov model and print the confusion matrix''',
choices = ['Demo','CNN','HMM','Data'] ,
default='Demo')
args = parser.parse_args()
if args.mode == 'Demo':
print('Demo mode on')
f.synthetic_data_generator()
print('Example Dataset Created')
model = f.Model()
print(model.summary())
history = model.train()
print('Model is Trained')
model.validate()
model.insights()
elif args.mode == 'Data':
print('Data mode on')
f.synthetic_data_generator()
print('Example Dataset Created')
elif args.mode == 'CNN':
model = f.Model()
print(model.summary())
history = model.train()
elif args.mode == 'HMM':
print('HMM mode on')
plt.show()