Models and neuron groups
Noise
-
You can start by thinking of
xias just a Gaussian random variable with mean 0 and standard deviation 1. -
This gives it units of
1/sqrt(second).
State variables
- Brian also defines two variables automatically
i
The index of a neuron
N
The total number of neurons - To get the values without physical units, use an underscore after the name
- The value of state variables can also be set using string expressions
- You can also set the value only if a condition holds
Subgroups
It is often useful to refer to a subset of neurons, this can be achieved using Python’s slicing syntax
Shared variables
- It have a common value for all neurons
- In contrast to external variables, such variables can change during a run, e.g. by using
run_regularly() - They cannot be written to in contexts where statements apply only to a subset of neurons
- If a code block mixes statements writing to shared and vector variables, then the shared statements have to come first.
- For shared variables, setting by string expressions can only refer to shared values
Storing state variables
- A dictionary of values. This can be done with the
get_states()andset_states()methods - The data (without physical units) can also be exported/imported to/from Pandas data frames
Linked variables
- A
NeuronGroupcan define parameters that are not stored in this group, but are instead a reference to a state variable in another group. For this, a group defines a parameter aslinkedand then useslinked_var()to specify the linking. - If the two groups have the same size, the linking will be done in a 1-to-1 fashion. If the source group has the size one (as in the above example) or if the source parameter is a shared variable, then the linking will be done as 1-to-all. In all other cases, you have to specify the indices to use for the linking explicitly
posted on 2020-08-16 03:02 ctrlplayer 阅读(172) 评论(0) 收藏 举报
浙公网安备 33010602011771号