main.py 989 Bytes
Newer Older
1
from config import config
okiss's avatar
okiss committed
2
from ensemble import run
3
import numpy as np
okiss's avatar
okiss committed
4
import scipy
Ard Kastrati's avatar
Ard Kastrati committed
5
from utils.utils import select_best_model, comparison_plot_loss, comparison_plot_accuracy
okiss's avatar
okiss committed
6
from utils import IOHelper
okiss's avatar
okiss committed
7
from scipy import io
okiss's avatar
okiss committed
8
import h5py
okiss's avatar
okiss committed
9
10
import logging
import time
11

Ard Kastrati's avatar
Ard Kastrati committed
12
13
14
15
from kerasTuner import tune
from utils import IOHelper


16
def main():
Ard Kastrati's avatar
Ard Kastrati committed
17
18
    logging.basicConfig(filename=config['info_log'], level=logging.INFO)
    logging.info('Started the Logging')
19
    start_time = time.time()
20
    # try:
Ard Kastrati's avatar
Ard Kastrati committed
21
    # trainX, trainY = IOHelper.get_mat_data(config['data_dir'], verbose=True)
okiss's avatar
okiss committed
22

Ard Kastrati's avatar
Ard Kastrati committed
23
24
25
    # if config['model'] == 'eegnet' or config['model'] == 'eegnet_cluster':
    #    trainX = np.transpose(trainX, (0, 2, 1))
    #     logging.info(trainX.shape)
Ard Kastrati's avatar
Ard Kastrati committed
26

27
    # tune(trainX,trainY)
Ard Kastrati's avatar
Ard Kastrati committed
28

Ard Kastrati's avatar
Ard Kastrati committed
29
    # run(trainX,trainY)
Ard Kastrati's avatar
Ard Kastrati committed
30
    # select_best_model()
Ard Kastrati's avatar
Ard Kastrati committed
31
    comparison_plot_accuracy()
Ard Kastrati's avatar
Ard Kastrati committed
32

Ard Kastrati's avatar
Ard Kastrati committed
33
34
    logging.info("--- Runtime: %s seconds ---" % (time.time() - start_time))
    logging.info('Finished Logging')
35

36
if __name__=='__main__':
zigeng's avatar
zigeng committed
37
    main()