-
Notifications
You must be signed in to change notification settings - Fork 4
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
Reconstruction matrix blending #4
Comments
the only time |
Not as important, but still...
is actually in ascending order... (a lot of weird stuff are everywhere like this) |
Decision required here:
|
Still not sure of what "this" exactly refers to. We should stick to the sklearn API, so in any case let's keep the code in transform(). If the adaptative mode is needed, it should be a boolean parameter of the constructor. |
As I understand it, the code
makes an interpolation between the reconstruction of the data with the current reconstruction matrix R and the previous one last_R. It may smooth the signal when two call of the RASR.transform(). Indeed, the reconstruction matrix R depends directly of the statistics of the signal, therefore each successive call of RASR.transform() gives a different R. Discontinuities will therefore appears at the edge of the epochs and can be smoothed with the blending. |
Oh, I remember our discussion now :) I think we should implement it, because of the weird artifacts that will appear otherwise, but I am open to counter-arguments. |
OK, I'll implement the blending with a condition if the reconstruction matrix changed. I'm closing this issue when implemented |
I'll be a little more cautious about this, since EEGLab did not respond to your comments on the matlab implementation. |
Noted:
This behaviour won't be in sprint2 but in sprint3. |
Comment: Due to current behaviour in Timeflux, each epoch = 1 reconstruction matrix. In the case of sliding windows for epoching, several epochs may have same timestamp but different resulting signals after RASR (because the reconstruction matrix changed). Blending such as proposed in the matlab implementation might be a great solution in Timeflux to merge redundant timestamp signals when required. It may be either an option withing RASR or managed outside RASR (e.g. blending node). |
Example of transition without(left) or with(right) blending. top: input signal. bottom: blended signal. Alternating between two reconstruction matrices (identity and [-1,1;1,1]) Pro of blending:
Con of blending:
Added to backlog #15 |
Following #5:
To do so:
PRO:
CON:
I can write down the code of a blending class, sklearn API compatible. |
EDIT:
Following the 2020-01-15 meeting, we decided to investigate the blending option and see what will be the best way to implement it. Two mains options has been discussed:
EDIT2:
Following the #5 and the drop of 2D compatibility, post-RASR blending seems the best option.
See #4 (comment)
Hi,
I'm struggling a bit to see if I'm stupid our there are some issues with the current matlab implementation of the the RASR process (transform for python).
First, I can't figure out in asr_process there is this weird "reconstruction to intermediate samples" that doesn't make sense to me.
R being NOT updated in this loop, doing
sounds exatly like doing
data(:,subrange) = R*data(:,subrange)
in a more fancy (and inefficient) way. Did I miss something ?I think that this line of code was supposed to do some kind of re-sampling interpolation but it doesn't make sense because there is no resampling. Another possibility: it was made to update R in the loop for overlapping windows (when you have to remove the contribution of the already filtered signal in the previous range). Anyway, I'm just putting this here because in the last commit, I considered that all that section was useless.
The text was updated successfully, but these errors were encountered: