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

srm: subtract the subject-specific mean in .transform() #407

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qihongl
Copy link
Member

@qihongl qihongl commented Jan 14, 2019

This is a fix described in #406 . With @cameronphchen 's fix, SRM can align two trajectories that differ by a vector shift by using the estimated mu.

@qihongl qihongl requested a review from mihaic January 14, 2019 15:57
@qihongl
Copy link
Member Author

qihongl commented Jan 14, 2019

Sorry, I didn't expected this to trigger some run test failures and I will take a look later...
btw, I can't view the linux and macos error. I got a message saying "qlu is missing the Overall/Read permission". Should I be able to look at the report?

@qihongl
Copy link
Member Author

qihongl commented Jan 14, 2019

Based on the travis report, the failure came from the tests for sssrm. It seems that sssrm is using (and only using) the _init_w_transforms function from srm, but the error occured when calling the fit function of sssrm. So I'm a little confused about why changing the transform function from srm would break that, since srm's transform doesn't call srm's _init_w_transforms... Any clue?

@mihaic
Copy link
Member

mihaic commented Jan 14, 2019

See PR #408.

Copy link
Contributor

@TuKo TuKo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in transform() looks correct.
However, the same bug should be corrected for computing a new subject in the function in
Line 384.

In addition, as the class actually differs from others, please update the documentation for DetSRM, RSRM and SS-SRM mentioning that each of these algorithms don't apply mean removal as SRM.

@qihongl
Copy link
Member Author

qihongl commented Jan 15, 2019

@TuKo Ah I see. transform_subject() is solving a standard procrustes problem. Is there a direct extension for procrustes with an intercept? Or does it make sense just do some mean centering, align by standard procrustes, and add the mean back? I'm frankly not sure what's the best thing to do here.

Right, the documentation should be updated. And later on I can modify my notebook to show detSRM doesn't align two trajectories differ by a vector shift whereas SRM does, and upload it to example/.

@qihongl
Copy link
Member Author

qihongl commented Jan 18, 2019

@TuKo I had a conversation with Sam and I guess for the transform_subject() function with intercept (i.e. mu), we probably want to do some mean centering for the estimated S and X_new, then align, and add the mean of S back. In this case, I was wondering if the user should do this manually? Does it seem strange to do this for the user implicitly?

@TuKo
Copy link
Contributor

TuKo commented Jan 18, 2019

@qihongl transform_subject() should compute the mean and substract it from data to compute the new subject's transform (see here ). BTW, the mu obtained for the new subject should be returned from the function as well.

Please note that DetSRM, RSRM and SS-SRM should follow SRM by removing mean.
I was suggesting to document the other classes, but you are welcome to modify them too. :)

@qihongl
Copy link
Member Author

qihongl commented Jan 19, 2019

I see! Thanks! @TuKo

@mihaic
Copy link
Member

mihaic commented Feb 24, 2020

@qihongl, any progress?

@mihaic
Copy link
Member

mihaic commented Mar 9, 2020

@qihongl, are you planning to finish this PR?

@qihongl
Copy link
Member Author

qihongl commented Mar 9, 2020

Ah my github is not linked to my main email address so I didn't notice this. And I totally forgot this PR.

Right I should finish this PR -- I will work on it get back to you guys in 2 weeks!

@mihaic mihaic added this to the v0.11.1 milestone Feb 22, 2021
@qihongl
Copy link
Member Author

qihongl commented Apr 8, 2021

Sorry I finally got to this... Can I make a new clone of the latest brainiak and start this from scratch?

@mihaic
Copy link
Member

mihaic commented Apr 8, 2021

If that works better for you, go ahead, @qihongl.

@qihongl
Copy link
Member Author

qihongl commented Apr 8, 2021

sounds great!

@qihongl
Copy link
Member Author

qihongl commented Apr 9, 2021

@mihaic
I want to update the documentation for DetSRM, RSRM and SS-SRM to mention that they don't apply mean removal as SRM. Should I just add this comment in the class doc string? Thanks!

@mihaic
Copy link
Member

mihaic commented Apr 9, 2021

Yes, the class docstring is a good spot. Of course, it would be even better to change the other code as well. Up to you.

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.

None yet

3 participants