main.py 804 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
from scipy import io
okiss's avatar
okiss committed
6
import h5py
okiss's avatar
okiss committed
7
8
import logging
import time
9

Ard Kastrati's avatar
Ard Kastrati committed
10
11
12
13
from kerasTuner import tune
from utils import IOHelper


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

    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
24
25
26
    # run(trainX,trainY)

    tune(trainX,trainY)
Ard Kastrati's avatar
Ard Kastrati committed
27
28
    logging.info("--- Runtime: %s seconds ---" % (time.time() - start_time))
    logging.info('Finished Logging')
29

30
if __name__=='__main__':
zigeng's avatar
zigeng committed
31
    main()