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 random seed for ANTs #916

Merged
merged 6 commits into from
May 28, 2023
Merged

Add random seed for ANTs #916

merged 6 commits into from
May 28, 2023

Conversation

14thibea
Copy link
Collaborator

Hello all :)

For a project using ANTs we would need to have a deterministic setup. This is the aim of this PR in which a value can be given for the random seed of ANTs, thus leading to the same result (using the same computer).
Before merging it would be worth testing if the results are the same on different computers as well. Also this could be checked in the CI.

Best,

@14thibea 14thibea requested a review from ghisvail May 15, 2023 12:05
@14thibea 14thibea added the enhancement New feature or request label May 15, 2023
.gitignore Show resolved Hide resolved
docs/Pipelines/T1_Linear.md Outdated Show resolved Hide resolved
@ghisvail
Copy link
Collaborator

@14thibea shall I merge this as is, or are there other things you need to test? Your PR is still at draft stage atm.

@14thibea
Copy link
Collaborator Author

Hi @ghisvail
I am going to run t1-linear in another machine (Linux) to check I have the same result!
If it works I will try to put this on the CI as well :)

@14thibea 14thibea marked this pull request as ready for review May 17, 2023 08:03
@14thibea
Copy link
Collaborator Author

I checked and I don't get exactly the same result on 2 different machines :(
But at least they are much closer than two different random seeds on the same machine...

@sophieloiz
Copy link
Contributor

Hi @ghisvail, from what I understand, this PR addresses the random seed issue just for the t1-linear pipeline. Would it be possible to also add this seed for the flair-linear pipeline ?

@ghisvail
Copy link
Collaborator

Hi @ghisvail, from what I understand, this PR addresses the random seed issue just for the t1-linear pipeline.

Actually, both t1-linear and flair-linear use the same anat-linear pipeline underneath. So flair-linear will also benefit from the pieces of improvement proposed by @14thibea 👍

@sophieloiz
Copy link
Contributor

Perfect, thanks ! Do we need to modify the flair_linear_cli.py file to add the --random_seed parameter ?

clinica/pipelines/t1_linear/t1_linear_cli.py Outdated Show resolved Hide resolved
@ghisvail
Copy link
Collaborator

Just a quick heads-up:

  • Following Friday's meeting, I added random seed support to pet-linear
  • I took the liberty to do some refactoring in the process, i.e.:
    • Move the random seed option to cli_param as it is now used by more than one pipeline
    • Use assignment expressions since we are on Python 3.8+ and they simplify the code

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

Successfully merging this pull request may close these issues.

3 participants