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
[MRG] fix inconsistent random state assignment between parallel trials #171
Changes from 3 commits
bc59634
dfa6445
7118e29
b340fe0
b8f5d1d
98a4050
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,10 +86,11 @@ def _clone_and_simulate(self, net, trial_idx): | |
from hnn_core.network_builder import NetworkBuilder | ||
from hnn_core.network_builder import _simulate_single_trial | ||
|
||
if trial_idx != 0: | ||
net.params['prng_*'] = trial_idx | ||
for param_key in net.params['prng_*'].keys(): | ||
net.params[param_key] += trial_idx | ||
|
||
neuron_net = NetworkBuilder(net) | ||
neuron_net.net.trial_idx = trial_idx | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this equivalent to https://github.com/jonescompneurolab/hnn-core/pull/171/files#diff-ca5f146e027d9dc6ef29ff4db9c21ca2R68 ? I have a suspicion it is not. Can you check? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, I messed this up. Fixed in b340fe0. |
||
dpl = _simulate_single_trial(neuron_net) | ||
|
||
spikedata = neuron_net.get_data_from_neuron() | ||
|
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.
should we add an "XXX" in the comment somewhere? To indicate that this is a hack (right?) and we should get rid of at some point
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.
Hmm, I'm not sure in this scenario what delineates a hack from a long-term bug fix. We plan to refactor the params and feed modules wrt how feed objects and their respective parameters are passed to
Network
andNetworkBuilder
. Along the way we will end up simplifying the code by e.g. removing the need for callingcreate_pext()
here. That said, I'm happy to update the comment if you think it'd be clearer.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.
yeah, I agree it might go away but just leaving an XXX tells future contributors that it's a hack that needs to fixed.