Commit 3f84b2c9 authored by Martyna Plomecka's avatar Martyna Plomecka
Browse files

Finished EEGNet ensemble without shuffling

parent c4e6164c
...@@ -115,7 +115,7 @@ class ConvNet(ABC): ...@@ -115,7 +115,7 @@ class ConvNet(ABC):
# early_stop = tf.keras.callbacks.EarlyStopping(monitor='val_accuracy', patience=20) # early_stop = tf.keras.callbacks.EarlyStopping(monitor='val_accuracy', patience=20)
ckpt_dir = config['model_dir'] + '/' + config['model'] + '_' + 'best_model.h5' ckpt_dir = config['model_dir'] + '/' + config['model'] + '_' + 'best_model.h5'
ckpt = tf.keras.callbacks.ModelCheckpoint(ckpt_dir, verbose=1, monitor='val_accuracy', save_best_only=True, mode='auto') ckpt = tf.keras.callbacks.ModelCheckpoint(ckpt_dir, verbose=1, monitor='val_accuracy', save_best_only=True, mode='auto')
X_train, X_val, y_train, y_val = train_test_split(x, y, test_size=0.2, random_state=42) X_train, X_val, y_train, y_val = train_test_split(x, y, test_size=0.199182, shuffle=False)
prediction_ensemble = prediction_history((X_val,y_val)) prediction_ensemble = prediction_history((X_val,y_val))
hist = self.model.fit(X_train, y_train, verbose=2, batch_size=self.batch_size, validation_data=(X_val,y_val), hist = self.model.fit(X_train, y_train, verbose=2, batch_size=self.batch_size, validation_data=(X_val,y_val),
epochs=self.epochs, callbacks=[csv_logger, ckpt, prediction_ensemble]) epochs=self.epochs, callbacks=[csv_logger, ckpt, prediction_ensemble])
......
...@@ -149,7 +149,7 @@ class Classifier_EEGNet: ...@@ -149,7 +149,7 @@ class Classifier_EEGNet:
early_stop = tf.keras.callbacks.EarlyStopping(monitor='val_accuracy', patience=20) early_stop = tf.keras.callbacks.EarlyStopping(monitor='val_accuracy', patience=20)
ckpt_dir = config['model_dir'] + '/' + config['model'] + '_' + 'best_model.h5' ckpt_dir = config['model_dir'] + '/' + config['model'] + '_' + 'best_model.h5'
ckpt = tf.keras.callbacks.ModelCheckpoint(ckpt_dir, verbose=1, monitor='val_accuracy', save_best_only=True, mode='auto') ckpt = tf.keras.callbacks.ModelCheckpoint(ckpt_dir, verbose=1, monitor='val_accuracy', save_best_only=True, mode='auto')
X_train, X_val, y_train, y_val = train_test_split(eegnet_x, y, test_size=0.2, random_state=42) X_train, X_val, y_train, y_val = train_test_split(eegnet_x, y, test_size=0.199182, shuffle=False)
pred_ensemble = prediction_history((X_val,y_val)) pred_ensemble = prediction_history((X_val,y_val))
hist = self.model.fit(X_train, y_train, verbose=1, validation_data=(X_val,y_val), hist = self.model.fit(X_train, y_train, verbose=1, validation_data=(X_val,y_val),
epochs=self.epochs, callbacks=[csv_logger, ckpt, early_stop,pred_ensemble]) epochs=self.epochs, callbacks=[csv_logger, ckpt, early_stop,pred_ensemble])
......
...@@ -43,7 +43,6 @@ Cluster can be set to clustering(), clustering2() or clustering3(), where differ ...@@ -43,7 +43,6 @@ Cluster can be set to clustering(), clustering2() or clustering3(), where differ
# Choosing model # Choosing model
config['model'] = 'eegnet' config['model'] = 'eegnet'
config['model'] = 'cnn'
config['downsampled'] = False config['downsampled'] = False
config['split'] = False config['split'] = False
config['cluster'] = clustering() config['cluster'] = clustering()
......
This diff is collapsed.
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