-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Problem using EEGNet on ERN dataset #47
Comments
@ZhYGu can you provide your code ? |
The following is my code from numpy import * def bandpass(sig,band,fs): #training preprocessing freq=200 X=[] #filter to 1,40 hz and downsample to 128 hz
Training_Labels=array(genfromtxt(Root_folder+'TrainLabels.csv',delimiter=',',skip_header=1)[:,1]) #testing data
test_X=array(X_).transpose((0,2,1)) #normalization from EEGModels import EEGNet from sklearn.pipeline import make_pipeline #Training Validation segmentation Training=Zeros[0:int(0.8len(Zeros))] Training=array(Training) chans=Training.shape[1] Training_Label=np_utils.to_categorical(Training_Label) Training_data=Training.reshape(Training.shape[0],chans,samples,kernels) print('Training shape:', Training_data.shape) model=EEGNet(nb_classes=2,Chans=chans,Samples=samples, #Training plt.plot(fittedModel.history['loss']) True_Labels=array(genfromtxt(Root_folder+'true_labels.csv',delimiter=',',skip_header=0)) Y_test=np_utils.to_categorical(True_Labels) X_test=test_X.reshape(test_X.shape[0],chans,samples,kernels) probs=model.predict(X_test) preds=probs.argmax(axis=-1) acc=np.mean(preds==Y_test.argmax(axis=-1)) import sklearn.metrics as metrics fpr,tpr,thresholds=metrics.roc_curve(True_Labels,preds,pos_label=1) print(auc) |
Additionally, after training, I plot the training and validation loss, but the validation loss is less than training loss. If you can find the problem related to it in my code, please tell me too. |
@okbalefthanded |
@ZhYGu to replicate the paper's results, use the same traning configuration, change the optimizer to Adam, batch size to 32 and epochs to 500. |
Thanks for your advice. I will run the experiment follow your suggestion. |
|
I followed the code in the example for applying on ERP dataset and tried it on ERN dataset. However, the result shows as random classification. I applied bandpass filter too, but I cannot understand what makes it a random classification. Do you have any suggestion?
The text was updated successfully, but these errors were encountered: