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

Implement effective_tau_syn #38

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

AlexVanMeegen
Copy link
Member

Started to implement the effective time constant in case there are multiple types of receptors with different synaptic time constants involved. Simply follows Forcaud & Brunel 2002 eq. (5.49).

The main functionality is there, however I have a few questions @moritzlayer (hence this is a draft only):

  • Can I simply introduce the parameter tau_s_ext for the synapses mediating the external input? Or does this require further changes in the model workflow?
  • The effective time constant depends on the presynaptic activity. Thus, it needs to be evaluated in firing_rates similar to mean_input and std_input. Accordingly, the additional parameter tau_s_ext appears in quite a few places - is there a good way to make sure one does not miss one of them?
  • What does one do with a 1d array, do we imply that the time constants are the same for all postsynaptic neurons?
  • Same problem if tau_s_ext is not explicitly provided - what do we assume?

Due to all of these complications, I am not sure if it is a good idea to implement this functionality.

@moritzlayer
Copy link
Contributor

First, I would to say that I am convinced that we should implement this feature. If we cannot manage to do so, we need to think about what the problems are, because we want this toolbox to be as easily extendible as possible.

Nevertheless, we need to do it in a smart way, as the procedure for calculating the firing rates will be different for having the same tau_s for all populations compared to multiple time constants. I think in branch 1.1-develop we already made a step into the right direction. Have a look at nnmt._solvers._firing_rate_integration. I generalized the function, such that one has to pass a list of input_funcs which are evaluated during the iteration procedure. We probably could think about nnmt.lif.exp._firing_rates pass different lists of input functions depending on tau_s.

Can you tell me how the interplay between the post-synaptic time constants and the external synaptic time constants looks like? Do they enter the sum for calculating the effective time constant similarly to the terms of the recurrent connections

?

What do you mean by

What does one do with a 1d array, do we imply that the time constants are the same for all postsynaptic neurons?

Shouldn't the post-synaptic time constants be the pre-synaptic time constants for the recurrent connections, so we would only need a 1d array to specify them?

To answer your other questions:

Can I simply introduce the parameter tau_s_ext for the synapses mediating the external input? Or does this require further changes in the model workflow?

I don't think this affects the model workflow. Extracting the time constants from the models should remain the same. We just need to decide on

Same problem if tau_s_ext is not explicitly provided - what do we assume?

I never really thought about the time constants of the external input, because it never seemed to enter the equations (see mean and std calculation). But with regard to my question above, this might be different now.

@AlexVanMeegen
Copy link
Member Author

Thanks for the quick response! The generalization in _firing_rate_integration indeed looks very helpful, probably one simply needs to pass effective_tau_syn in addition to mean_input etc. And nice to hear that a change likely introducing tau_s_ext won't cause a cascade of downstream changes!

Re. the tau_syn of external input: I think one can simply extend the sum over b to include the external input.

I (currently) think the most general way to specify synaptic time constants is a matrix tau_{a,b} for the recurrent connections and a vector tau_{a,ext} for the external input. In principle, the type of synapse and the associated time constant could depend on the properties of both pre- and postsynaptic neuron and this way one can account for this. In practice, one might often choose a specific type of synapses for e.g. excitatory inputs such that tau_{a,b} only depends on the presynaptic index b and hence might be represented by a vector - but in general, if one passes only a vector and not a matrix it is ambiguous if the entries correspond to a or b. Does this answer our question(s)?

For completeness, here are my notes on this: mft_different_tau_syn.pdf

@moritzlayer
Copy link
Contributor

Yes, I think this answers the questions.

Regarding the interpretation of a vector of tau_s: Naively, my interpretation would be that each population represents one neuron type, coming with its own values for the synaptic time constant, such that it occurs in the recurrent connections like in this plot:
synaptic_time_constants

However, this interpretation would require tau_s_ext to be passed explicitly. To me it feels weird to associate one fixed synaptic time constant to all inputs of a population. What do you think?

@AlexVanMeegen
Copy link
Member Author

Great. I agree with your "naive" interpretation.

To me it feels weird to associate one fixed synaptic time constant to all inputs of a population.

Here you mean to associate the synaptic time constant with the postsynaptic neuron, i.e. tau_{a,b} does not depend on b, right? If this is what you mean I agree. Probably the solution is to allow both options and make the "naive" one the default, right?

@moritzlayer
Copy link
Contributor

Excatly, this is what I meant.

Probably the solution is to allow both options and make the "naive" one the default, right?

Yes, I think this is a good idea.

If multiple synaptic time constants are passed to the firing rates,
the effective synaptic time constants are calculated using Eq. 5.49
in Fourcaud and Brunel 2002.
@moritzlayer
Copy link
Contributor

Sorry for the delay. My thesis required some attention last month :D

However, now I implemented the integration procedure which adapts to either having a single synaptic time constant or having multiple synaptic time constants. I also added an example that compares the results to a simple NEST simulation, and it seems to work fairly well. However, I only played around with the simple case of two synaptic time constants. Maybe you have a more elaborate network that we could use to try the method. Please have a look at the example; any feedback would be greatly appreciated.

I still need to write some tests and adjust a few docstrings.

Can you make this a pull request to the branch develop? I don't know whether that's possible, but please let me know.

@AlexVanMeegen AlexVanMeegen changed the base branch from master to develop April 13, 2022 10:36
@AlexVanMeegen
Copy link
Member Author

Actually thought this was on my table! :D Not sure when I'll have time to look into this, I'll try not to delay it. Just FYI, I also never looked at an example with more than two time constants.

Already changed the base branch to develop according to these instructions. Let me know if sth looks off.

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.

2 participants