main.py 862 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

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

    if config['model'] == 'eegnet' or config['model'] == 'eegnet_cluster':
        trainX = np.transpose(trainX, (0, 2, 1))
        logging.info(trainX.shape)
    run(trainX,trainY)
okiss's avatar
okiss committed
23
24
    select_best_model()
    comparison_plot(n_best = 4)
Ard Kastrati's avatar
Ard Kastrati committed
25
26
    logging.info("--- Runtime: %s seconds ---" % (time.time() - start_time))
    logging.info('Finished Logging')
27

28
if __name__=='__main__':
zigeng's avatar
zigeng committed
29
    main()