Commit 62af2c98 authored by okiss's avatar okiss
Browse files

select & comparison

parent 6529c1ed
......@@ -2,6 +2,8 @@ from config import config
from ensemble import run
import numpy as np
import scipy
from utils.utils import select_best_model, comparison_plot
from utils import IOHelper
from scipy import io
import h5py
import logging
......@@ -12,46 +14,14 @@ def main():
logging.info('Started the Logging')
start_time = time.time()
# try:
# trainX, trainY = IOHelper.get_mat_data(config['data_dir'], verbose=True)
f = io.loadmat('trainX.mat')
trainX = f['trainX'].reshape(-1,500,129)[:20,...]
trainY=io.loadmat('trainY.mat')['trainY'][:20]
trainX, trainY = IOHelper.get_mat_data(config['data_dir'], verbose=True)
if config['model'] == 'eegnet' or config['model'] == 'eegnet_cluster':
trainX = np.transpose(trainX, (0, 2, 1))
logging.info(trainX.shape)
run(trainX,trainY)
'''
if config['model'] == 'cnn' or config['model'] == 'cnn_cluster':
logging.info("Started running CNN. If you want to run other methods please choose another model in the config.py file.")
CNN.run(trainX, trainY)
elif config['model'] == 'eegnet' or config['model'] == 'eegnet_cluster':
logging.info(
"Started running EEGNet. If you want to run other methods please choose another model in the config.py file.")
eegnet_x = np.transpose(trainX, (0, 2, 1))
logging.info(eegnet_x.shape)
eegNet.run(trainX=eegnet_x, trainY=trainY)
elif config['model'] == 'inception' or config['model'] == 'inception_cluster':
logging.info("Started running InceptionTime. If you want to run other methods please choose another model in the config.py file.")
inception.run(trainX=trainX, trainY=trainY)
elif config['model'] == 'xception' or config['model'] == 'xception_cluster':
logging.info("Started running XceptionTime. If you want to run other methods please choose another model in the config.py file.")
xception.run(trainX=trainX, trainY=trainY)
elif config['model'] == 'deepeye' or config['model'] == 'deepeye_cluster':
logging.info("Started running DeepEye. If you want to run other methods please choose another model in the config.py file.")
deepeye.run(trainX=trainX, trainY=trainY)
elif config['model'] == 'deepeye-rnn' or config['model'] == 'deepeye-rnn_cluster':
logging.info("Started running deepeye-rnn. If you want to run other methods please choose another model in the config.py file.")
deepeyeRNN.run(trainX=trainX, trainY=trainY)
else:
logging.info('Cannot start the program. Please choose one model in the config.py file')
'''
select_best_model()
comparison_plot(n_best = 4)
logging.info("--- Runtime: %s seconds ---" % (time.time() - start_time))
logging.info('Finished Logging')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment