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

Add Parcel and Searchlight Hyperalignment methods #74

Merged
merged 77 commits into from
Mar 11, 2024

Conversation

denisfouchard
Copy link
Collaborator

@denisfouchard denisfouchard commented Dec 21, 2023

For future reference, this PR is intended to add the Individualized Tuning model (see paper) into fmralign and compare it to FastSRM (H. Richard et. al. , 2019)

Copy link
Contributor

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

Are these things tested or demoed somewhere ?

fmralign/template_alignment.py Outdated Show resolved Hide resolved
@emdupre
Copy link
Collaborator

emdupre commented Dec 21, 2023

Hi @denisfouchard,

Thanks for this addition ! Just to +1 @bthirion 's comments, it'd be great to have these new calls explicitly added into new examples and tests. This is adding a new dependency to the library, so it'd be especially useful to showcase why it's a good addition.

Just to note : you'll also need to modify the pyproject.toml accordingly ! The test errors are associated with recent nilearn updates, so it's hiding what will later be an import error for the hyperalignment package.

In the meantime, I'll update these nilearn calls so your changes are against a passing main branch !

@denisfouchard
Copy link
Collaborator Author

Hi @emdupre and thanks for the message ! I will review and adapt to your suggestions in the days to come

In the meantime, enjoy your end of the year festivities !

@denisfouchard
Copy link
Collaborator Author

Hi @bthirion I will add plots to the package. For the tests, there are in the hyperalignment package I have been working on from the begining ;)

@denisfouchard
Copy link
Collaborator Author

There is an other problem, that we will need to adress at some point (maybe at the end of holidays) : we are importing the Hyperalignment package that is going to be private for the rest of its life maybe (as long as Feilong keeps it private at least), so we will need maybe to adapt the code ? We can not just add hyperalignment to the requirements and pip install it directly

@bthirion
Copy link
Contributor

We don't want to depend on hyperalignment. We need to copy the relevant code here.

@denisfouchard
Copy link
Collaborator Author

We don't want to depend on hyperalignment. We need to copy the relevant code here.

The problem is that there is a lot of code, and a lot of files. It would imply to copy a ton of files in the package

@bthirion
Copy link
Contributor

bthirion commented Jan 2, 2024

Yes, but not much more than other estimators. The point is to factorize as much as possible.

@denisfouchard
Copy link
Collaborator Author

I'll do my best.
But for example FastSRM is imported, not integrated, and hyperalignment uses a lot of very custom code

@bthirion
Copy link
Contributor

bthirion commented Jan 3, 2024

FastSRM has been worked out quite well, and is relatively high quality, this is why we can rely on it.

@denisfouchard
Copy link
Collaborator Author

I tried to compress and remove all the unnecessary stuff to include it directly in fmralign. Sadly I think I can not go further, as hyperalignment does not seem to fit in the "template_alignment". It is its own unique way of doing alignment

@denisfouchard
Copy link
Collaborator Author

If we really want to have the minimum amount of files I can put everything in one file, but this is a bit risky and not very pleasing to read.

Copy link
Contributor

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

Looks great. I think there is room for improvement, by abiding better to sklearn's conventions.

fmralign/alignment_methods.py Outdated Show resolved Hide resolved
fmralign/alignment_methods.py Outdated Show resolved Hide resolved
fmralign/alignment_methods.py Outdated Show resolved Hide resolved
fmralign/alignment_methods.py Outdated Show resolved Hide resolved
fmralign/alignment_methods.py Outdated Show resolved Hide resolved
fmralign/hyperalignment/model.py Outdated Show resolved Hide resolved
fmralign/hyperalignment/regions_alignment.py Outdated Show resolved Hide resolved
fmralign/hyperalignment/regions_alignment.py Outdated Show resolved Hide resolved
fmralign/tests/test_alignment_methods.py Outdated Show resolved Hide resolved
fmralign/tests/test_alignment_methods.py Outdated Show resolved Hide resolved
@bthirion
Copy link
Contributor

Indeed.
I'm assuming that you have enough tests and examples to control what you're doing.
Anyway, git is your friend, you can always revert changes.

Copy link
Collaborator Author

@denisfouchard denisfouchard left a comment

Choose a reason for hiding this comment

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

.

Copy link
Contributor

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

I think it can be merged now.

@denisfouchard
Copy link
Collaborator Author

@emdupre what do u think ? :)

fmralign/generate_data.py Outdated Show resolved Hide resolved
@emdupre
Copy link
Collaborator

emdupre commented Mar 4, 2024

Thank you, @denisfouchard !! This looks great 🚀 Only small comments, and then I think it's good to go !

@denisfouchard
Copy link
Collaborator Author

I have made changes according to @emdupre's latest comments. Tbh I don't want to adress now comments about code choices that were made at the begining and that were left uncommented for the whole 3 last months 😅. I did what I could, but I think it is the best we can do for INT !

@emdupre
Copy link
Collaborator

emdupre commented Mar 6, 2024

I have made changes according to @emdupre's latest comments. Tbh I don't want to adress now comments about code choices that were made at the begining and that were left uncommented for the whole 3 last months 😅. I did what I could, but I think it is the best we can do for INT !

Thanks, @denisfouchard ! I know that longer reviews are frustrating, but please remember that this is a huge amount of code (for everyone) with very little context (e.g. the conversations on licensing, notification of ready-to-review status, etc) for me.

Regardless, it's fine if you don't want to address at this point any potentially remaining code changes in this PR, but please at least respond to comments brought up in a review so we know if we need to open a dedicated issue.

Thanks again for your work on this.

@denisfouchard
Copy link
Collaborator Author

I have made changes according to @emdupre's latest comments. Tbh I don't want to adress now comments about code choices that were made at the begining and that were left uncommented for the whole 3 last months 😅. I did what I could, but I think it is the best we can do for INT !

Thanks, @denisfouchard ! I know that longer reviews are frustrating, but please remember that this is a huge amount of code (for everyone) with very little context (e.g. the conversations on licensing, notification of ready-to-review status, etc) for me.

Regardless, it's fine if you don't want to address at this point any potentially remaining code changes in this PR, but please at least respond to comments brought up in a review so we know if we need to open a dedicated issue.

Thanks again for your work on this.

Sure, I think I replied to every comment ! (I did move the functions of toy data generations as you proposed)

LMK if it is good for you or if anything should have its own PR if ;)

@bthirion
Copy link
Contributor

@emdupre WDYT ?

Copy link
Collaborator

@emdupre emdupre left a comment

Choose a reason for hiding this comment

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

I think this is ready 🚀

Thanks @denisfouchard for the (huge) lift !! Excited to see this added.

@bthirion
Copy link
Contributor

Merging, then. Thx to all !

@bthirion bthirion merged commit 9afc151 into Parietal-INRIA:main Mar 11, 2024
4 checks passed
@denisfouchard
Copy link
Collaborator Author

Great ! Thank you for the reviews !

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.

4 participants