-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
complexwarning when using asr? #77
Comments
Hi @jeremylinwx , thanks for flagging this. I will need more context in order to resolve this. Can you share a small chunk of data that causes the problem so I can replicate the issue? |
hi, thanks for responding so quickly |
Github won't let you sent .mat files. You either need to zip it, or host it somewhere like wetransfer |
calibration.mat.zip |
Thanks that works, I'll look into it ASAP |
thank you; also, we arent on the latest version of meegkit; im not sure which version we are actually using, it just says 0.1; let me know if you need the versions of any of the other packages we have in our environment |
Hello again. Just to clarify and to not cause any confusion I want to point out that the original complexwarning I mentioned was occurring in an older version of meegkit (0.1). The error seems to be in the geometric_median() function which was not present in the first version of meegkit (0.1) that I was using. I tried replace lines 578 , 579 in asr.py with 575, 576 and the TEST-meegkit.py was able to run without error. The data not processed with ICA resulted in a good reconstructed signal. However, the data processed with ICA signal resulted in a bad reconstructed signal. File details: |
Hi @jeremylinwx I'm trying to make sens of the data you sent over. Can you say a bit more about the shapes of the data I should be expecting (number of channels, number of trials, time points, sampling frequency)? |
Why do you only apply a bandpass filter to the |
Ok, last question : why do you go through the trouble of applying a bandpass filter on the Replacing this by asr.fit(calibration_signal)
# should be
# window = sliding_window(sig_sampled, window=250, step=250)
window = sliding_window(trial, window=250, step=250)
out = np.zeros_like(window)
for i in range(window.shape[1]):
print(i)
out[:, i, :] = asr.transform(window[:, i, :]) |
Yes, sorry, the matlab3.mat file is a single raw 8s-trial with 19 channels sampled at 500Hz; so it is 19 x 4000; |
Right sorry, this was my mistake. The preprocessing pipeline should be filtering --> downsampling --> ASR. The But I am still curious why running ICA and removing components from the calibration data results in distortions in the reconstructed data with ASR. As far as I can tell, the supplied calibration data files contains no information about ICA and only contains numerical values. Also, I have been testing the version of meegkit I have implemented with the latest version (0.1.7); using the same calibration files, it seems that the latest version is more lenient in handling artifacts and does not correct the signal as aggressively; was this implemented by design? (I will attach some pictures comparing the 2 versions once I have them organised) |
These are just some examples I have ran using the same calibration data file. Blue is the original and orange is the reconstructed data. version1 refers to the 0.1 version of meegkit and version7 refers to the latest 0.1.7 version of meegkit available here |
So you are applying ICA before fitting the ASR model? And then you are applying ASR on the non-ICA'd data? That sounds fishy to me. Either way, I don't think ASR is intended to work with rank-deficient data (TBC). I'm curious, have you encountered a paper where they do this (ICA then ASR)? My instinct would be to do the opposite (ASR then ICA).
I have not touched the ASR code in a while so this is really the case it is not intended behaviour. Will wait for you confirmation before digging into this further. |
This is not intended. Do you get any error / warning in 0.1.7 that you don't get in 0.1 ? |
Not exactly. We usually do ASR on our data before ICA. These are all done offline on MATLAB. However, our application is implemented on Python. The preprocessing pipeline is still in the same order. Its just I noticed this "complexWarning" while doing some testing on our application, and then noticed that the reconstructed data was distorted. After digging a little bit more, I found that I could recreate the "complexWarning" and distorted data if I used a calibration signal that has been ICA-ed. I can't trace the source of the calibration signal that initially created this issue since I wasn't the one that recorded it, but a quick look at it shows there aren't any blink artifacts in the 1-minute of data, which probably meant that it was processed with ICA. |
So far, no. Both versions run fine, no changes to the default values of the ASR class, just the reconstructed signals that differ quite drastically. |
Ok I'll look into it |
@jeremylinwx can you tell me what version you are referring to when you say The oldest version I uploaded on pypi is |
I am not exactly sure which version of meegkit this is, it just says 0.1; it was installed by someone else who had left the lab awhile ago and we aren't sure how he got hold of this package. I have attached what we have. |
i have 2 different calibration data, one of them causes the complexwarning to appear but the other doesnt. no error occurs regardless, but the calibration data that causes the complexwarning results in a weird looking reconstructed signal.
The text was updated successfully, but these errors were encountered: