-
Notifications
You must be signed in to change notification settings - Fork 56
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] Add probability arguments to drives API #416
[MRG] Add probability arguments to drives API #416
Conversation
Also I want to mention a potential concern I had that ended up not being a problem. Rather conveniently, this is gracefully handled by making sure the same seed is used when calling |
aee036b
to
cc2fd1c
Compare
add a test? |
Also, can you add closes #410 in the description of the PR ? |
Codecov Report
@@ Coverage Diff @@
## master #416 +/- ##
==========================================
- Coverage 88.49% 87.80% -0.70%
==========================================
Files 18 18
Lines 3267 3287 +20
==========================================
- Hits 2891 2886 -5
- Misses 376 401 +25
Continue to review full report at Codecov.
|
Few minor comments otherwise LGTM I see that there are a couple of other todos in the release checklist but this was not amongst them. Would you mind updating that checklist to reflect the latest shopping list? |
Can do! And apologies going off script w.r.t. release priorities, this came up as being very necessary for some preliminary grant analysis. |
@ntolley looks like we have a CI failure due to MNE. Can you reproduce the import issue locally (with a Python 3.6 conda env and doing pip install mne)? If so, we should report it to MNE, otherwise we can just restart the CI |
Reproduces locally, just posted an issue: mne-tools/mne-python#9700 |
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.
Aside from my two nitpicks above, this looks good to me!
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.
merge button is yours @rythorpe
2487c56
to
e0e1099
Compare
c090fe9
to
ba0bd93
Compare
delay=delays, lamtha=space_constant, | ||
probability=probability, | ||
conn_seed=drive['conn_seed'] + seed_increment) | ||
# Ensure that AMPA/NMDA connections target the same gids |
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.
@rythorpe I think this addresses your problem with enforcing shared connections with seeding. The connections for the same receptor are explicitly set to be equal to one another.
I additionally added seed_increment
to make sure that there aren't weird structural dependencies for the random subsets. I see a PR in the future that takes care of all the seeding as we discussed previously (seeds drawn from a single RNG).
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.
perhaps raise an issue with crosslink here to not forget?
if receptor_idx > 0: | ||
self.connectivity[-1]['src_gids'] = \ | ||
self.connectivity[-2]['src_gids'] |
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.
Is this necessary given that conn_seed
applies the same seed_increment
for each receptor of a given cell type?
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 is actually the root of the problem we were discussing with respect to enforcing matching connections. While technically these would share the same connections when providing the same seed, it's not very transparent, so they are explicitly set equal here.
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 think the root problem is addressed by explicitly implementing (with documentation) that random connections are assigned on a cell-by-cell basis rather than a synapse-by-synapse basis. This is perfectly implemented by setting the seed increment for each cell type in an outer loop and then establishing each receptor's connection in an inner loop. That said, maybe the explicit check is good for maintaining this established convention in the future....
@ntolley you need to rebase |
@ntolley don't forget to update |
ba0bd93
to
14dabf9
Compare
@rythorpe I'm not available until Sunday due to coding sprint in another project. Merge button is yours! |
I'll definitely be using this feature in the near future. Thanks @ntolley!! |
Closes #410. Thanks to #369, this task is quite straightforward. The goal of this PR is to add a probability argument to the drives API, such that
net.add_evoked_drive(..., probability=0.5)
randomly removes half the drive connections, and only a subset are actually targeted by the drive. Additionally, the probability argument should also accept a dictionary which specifies probabilities for each individual connection (same was the weight and delay arguments).After completing this, I think the final task for fully merging the drives and connection API's is enabling the manual targeting of
target_gids
, but let's leave that as a topic of discussion for the upcoming retreat ;).