numediart / EEGLearn-Pytorch

GNU General Public License v2.0
126 stars 33 forks source link

Questions about training and testing phase #3

Open homingZhang opened 4 years ago

homingZhang commented 4 years ago

Hi, Thanks for sharing Pytorch version of EEGLearn. Then, I am confused of the training and testing phase in the code. The main purpose of the code is to use leave-one-out CV to evaluate the model. However, it seems like that the code only selects 1 subject per time, then the training and testing phase are performed in this patient. Right? image

In my opinion, the subject (including all the images) selected is the testing subject, all the other subjects are training subjects.

Hope to hear from you soon.

Thank you very much.

VDelv commented 4 years ago

Hi,

Thanks for the interest in the code and sorry for the late answer. I first implemented (by mistake) the code with a simple participant dependent cross-validation (training and test from same subject).

If I have time I can put a simple implementation from scratch of LOSO cross-validation, it will be something like:

for patient in range(n_patient):
   idx = np.argwhere(Patient == patient)[:, 0]
   np.random.shuffle(idx)
   Test = Subset(Dataset, idx)
   idx = np.argwhere(Patient != patient)[:, 0]
   np.random.shuffle(idx)
   Train = Subset(Dataset, idx)

   Trainloader = DataLoader(Train, batch_size=64, shuffle=False)
   Testloader = DataLoader(Test, batch_size=64, shuffle=False)

I hope to have time to implement it correctly and let the user choose patient dependent or independent but I have a lot of side project for the moment.

I hope my temporary patch can help you,

Best,

Ninggggy commented 1 month ago

Hi, I'm a student and interested on this code and your questions. However it seems like that the file do not include the document of EEGLearn which you mentioned. Hope to get in touch with you and get the document of EEGLearn! Thank you! Here is my wechat number NkLny_05621