i. A practical application of Transformer (ViT) on 2-D physiological signal (EEG) classification tasks. Also could be tried with EMG, EOG, ECG, etc. ii. Including the attention of spatial dimension (channel attention) and *temporal dimension*. iii. Common spatial pattern (CSP), an efficient feature enhancement method, realized with Python.
It's an excellent work that inspired me a lot. Now I am appling it to a 2-class task for DatasetIV-2b. Which parameter should I change?
I've found some potential code, Could you help to locate the para that needs modifing? Thank you!
In Trans.py:
Line 130: forward_expansion=4
Line 167: emb_size=10, depth=3, n_classes=4
LIne 253: self.c_dim=4
In common_spatial_pattern.py:
Line 15: idx_3=... (comment this line?)
Line 18: in range(4) and following elif for n_class==3
Line 70: Wb = np.concatenate((W[0][:, 0:4], W[1][:, 0:4], W[2][:, 0:4], W[3][:, 0:4]), axis=1)
Thanks again.
Hello
After running the transformer a couple of times, I'm receiving significantly smaller results compared to the study's results. I've attached an image of one of my confusion matrices which in comparison with the study, is much worse.
The only code I've edited was for the purpose of using it in google collaborate, otherwise, all the code is the same as how it was here on GitHub. What would be the cause of this and am I missing something quite obvious that is missing?
Best
Merlin
Hi there,
I'm trying to implement your code on the BCI IV 2a dataset. However, I'm wondering how is the structure of the label and data in your mat file since I couldn't rebuild the mat file based on the "getData.m" function. If you can provide a tree structure of the data regarding trials and labels, it will be clearer.
Hello
I have been trying to get your getData.m function working but I have run into an issue with labelling the evaluation datasets. Each time I run the code, the labels for all of the subject's evaluation data are labelled as NaN, preventing the Trans.py code to have a test accuracy score other than 0.
I looked at the BCI competition IV website and subject 1 from dataset 2a should have class labels but when I run
[s, HDR] = sload('dir of A01E');
The HDR.ClassLabels are all NaN so am unsure where I am going wrong.
Any help would be appreciated.
Best
Merlin