Skip to content
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

bugfix ft_surrogate #409

Merged
merged 7 commits into from
Sep 29, 2022
Merged

Conversation

martinwimpff
Copy link
Collaborator

Bugfix as discussed in #408.

@codecov
Copy link

codecov bot commented Sep 22, 2022

Codecov Report

Merging #409 (d889c3a) into master (9cc8c68) will increase coverage by 1.17%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #409      +/-   ##
==========================================
+ Coverage   83.03%   84.20%   +1.17%     
==========================================
  Files          55       46       -9     
  Lines        3838     3616     -222     
==========================================
- Hits         3187     3045     -142     
+ Misses        651      571      -80     

@cedricrommel
Copy link
Collaborator

I just changed the linting in a long line, but everything LGTM :) Thanks a lot @martinwimpff !
I'll carry some tests regarding the comment above and let you know.

@bruAristimunha
Copy link
Collaborator

Nice @martinwimpff and @cedricrommel,

@martinwimpff, can you update the what's new file?

@martinwimpff
Copy link
Collaborator Author

@cedricrommel I had the same thought but I think this version makes more "physical" sense: if you interprete the phase perturbation as a simple time shift in the time domain, the perturbation should be the same across all channels. I would guess that this would not really affect the performance but I am looking forward to your test results ;)

@cedricrommel
Copy link
Collaborator

So, results are that if we sample phase perturbations independently for each channel we break cross-channels correlations, which are instrumental in tasks such as BCI. So we see on BCI IV 2a for example that augmenting as you were doing @martinwimpff (FTSurrogate) is way better than doing it with fully random phases (FTSurrogateIND):
image

However, for tasks where cross-channel correlations don't matter that much like sleep staging, we obtain slightly better improvements if we randomize as much as possible (i.e. independently for each channel):
image

So I've added an argument to control this and set the default to do it your way @martinwimpff since it is safer.

Thanks a lot for the bug fix and very insightful discussion !! :)

If the modifications I've made look good to you @martinwimpff and @bruAristimunha , I'll merge the PR as soon as it passes the tests!

@bruAristimunha
Copy link
Collaborator

looks wonderful to me :)

@robintibor
Copy link
Contributor

seems good so is this ready to merge?

@cedricrommel
Copy link
Collaborator

cedricrommel commented Sep 29, 2022 via email

@agramfort agramfort merged commit d0abec3 into braindecode:master Sep 29, 2022
@cedricrommel
Copy link
Collaborator

Thank you guys!! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants