main.py 942 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
okiss's avatar
okiss committed
5
6
from utils.utils import select_best_model, comparison_plot
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:
okiss's avatar
okiss committed
21
    trainX, trainY = IOHelper.get_mat_data(config['data_dir'], verbose=True)
okiss's avatar
okiss committed
22
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

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

Martyna Plomecka's avatar
Martyna Plomecka 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()
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()