-
Notifications
You must be signed in to change notification settings - Fork 95
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
[DOC] Update docstring for fixed_seed to ref None option #104
Conversation
Codecov Report
@@ Coverage Diff @@
## master #104 +/- ##
==========================================
- Coverage 45.42% 45.36% -0.06%
==========================================
Files 28 28
Lines 1585 1587 +2
==========================================
Hits 720 720
- Misses 865 867 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are just a couple of typos, but mostly looks good.
tedana/workflows/tedana.py
Outdated
@@ -149,7 +149,9 @@ def _get_parser(): | |||
parser.add_argument('--seed', | |||
dest='fixed_seed', | |||
type=int, | |||
help='Seeded value for ICA, for reproducibility.', | |||
help=('Value passed to repr(mdp.numx_rand.seed()) ' | |||
'Set to an integer value for reproducibile ICA results; ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reproducibile --> reproducible
@@ -149,7 +149,9 @@ def _get_parser(): | |||
parser.add_argument('--seed', | |||
dest='fixed_seed', | |||
type=int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break with None. Also (and this might not matter to anyone), but typing --fixed_seed None
is a little awkward. I think I've seen something like --fixed_seed -1
which would then be coerced to None later.
@@ -228,7 +230,9 @@ def tedana_workflow(data, tes, mixm=None, ctab=None, manacc=None, strict=False, | |||
Other Parameters | |||
---------------- | |||
fixed_seed : :obj:`int`, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:obj:int
or :obj:None
, I think.
tedana/workflows/tedana.py
Outdated
@@ -228,7 +230,9 @@ def tedana_workflow(data, tes, mixm=None, ctab=None, manacc=None, strict=False, | |||
Other Parameters | |||
---------------- | |||
fixed_seed : :obj:`int`, optional | |||
Seeded value for ICA, for reproducibility. | |||
Value passed to ``mdp.numx_rand.seed()``. | |||
Set to an integer value for reproducibile ICA results; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same typo as above.
@@ -260,7 +260,9 @@ def tedica(n_components, dd, conv, fixed_seed, cost, final_cost, | |||
conv : :obj:`float` | |||
Convergence limit for ICA | |||
fixed_seed : :obj:`int` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:obj:int
or :obj:None
tedana/decomposition/eigendecomp.py
Outdated
@@ -260,7 +260,9 @@ def tedica(n_components, dd, conv, fixed_seed, cost, final_cost, | |||
conv : :obj:`float` | |||
Convergence limit for ICA | |||
fixed_seed : :obj:`int` | |||
Seed for ensuring reproducibility of ICA results | |||
Value passed to ``mdp.numx_rand.seed()``. | |||
Set to an integer value for reproducibile ICA results; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reproducibile --> reproducible
I cheated and fixed the typos with an The awkwardness of
WDYT ? Do you have a preference here ? |
Smart! Regarding the fixed_seed values- I know that -1 breaks |
I just checked with I'm not enthusiastic about it, since I'd like to have results be reproducible out of the box unless a user knows and wants to specifically request non-replicable results. Happy to hear other thoughts, though ! Could you explain why you think |
@KirstieJane might have an opinion here, too, since her group also implemented a |
To be clear, the question is which should be the default, right? I can see both sides. There's a danger that groups won't mix up the random seed and therefore every run will be weirdly similar.....but I think the bigger danger is that people don't fix the random seed and every time they re-run the code they get (slightly) different answers. So, my not-very-strong vote is for the default to be an integer rather than None....but with clearly documentation to say - go ahead and change this value as you choose! |
The changes look fine to me. I'm fine merging, as is, but I'll make some comments in response to other's concerns regarding the default option and the awkwardness of --fixed_seed=None Earlier, I agreed that the default should be a fixed seed so that the default is replicable results, but understand why default randomness could be useful. If that's the general consensus, for replicability, we'd just need to save the random seed somewhere in the output. The easiest way to do this would be to use a random number generator to assign a value to tedana/tedana/decomposition/eigendecomp.py Line 284 in 0c5f93d
with
and then make sure that fixed_seed is actually part of the output of the code. I'd recommend this in general because, even if people use None, they might want to replicate a specific iteration at some point in the future. |
Endorse @handwerkerd's suggestion, even if we do keep a fixed seed as the default! 💯 |
Ok, I've edited this to take Happy to hear any other suggestions, here. And I'd always appreciate another review, @tsalo :) |
Merging ! |
Closes #87 .
Changes proposed in this pull request:
fixed_seed
argument in eigendecomp.py and tedana.py