Models and neuron groups

Noise

  1. You can start by thinking of xi as just a Gaussian random variable with mean 0 and standard deviation 1.

  2. This gives it units of 1/sqrt(second).

State variables

  1. Brian also defines two variables automatically
    i
    The index of a neuron
    N
    The total number of neurons
  2. To get the values without physical units, use an underscore after the name
  3. The value of state variables can also be set using string expressions
  4. 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

  1. It have a common value for all neurons
  2. In contrast to external variables, such variables can change during a run, e.g. by using run_regularly()
  3. They cannot be written to in contexts where statements apply only to a subset of neurons
  4. If a code block mixes statements writing to shared and vector variables, then the shared statements have to come first.
  5. For shared variables, setting by string expressions can only refer to shared values

Storing state variables

  1. A dictionary of values. This can be done with the get_states() and set_states() methods
  2. The data (without physical units) can also be exported/imported to/from Pandas data frames

Linked variables

  1. A NeuronGroup can 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 as linked and then uses linked_var() to specify the linking.
  2. 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)    收藏  举报

导航