Container that stores equations from which models can be created
Initialised as:
Equations(expr[,level=0[,keywords...]])
with arguments:
Systems of equations can be defined by passing lists of Equations to a new Equations object, or by adding Equations objects together (the usage is similar to that of a Python list).
String equations
String equations can be of any of the following forms:
Here each of x and y can be any valid Python variable name, f can be any valid Python expression, and unit should be the unit of the corresponding x. You can also include multi-line expressions by appending a \ character at the end of each line which is continued on the next line (following the Python standard), or comments by including a # symbol.
These forms mean:
Noise
String equations can also use the reserved term xi for a Gaussian white noise with mean 0 and variance 1.
Example usage
eqs=Equations('''
dv/dt=(u-v)/tau : volt
u=3*v : volt
w=v
''')
Details
For more details, see More on equations in the user manual.
For information on integration methods, and the StateUpdater class, see Integration.
Group of neurons
Initialised with arguments:
Methods
Returns the next sequential subgroup of N neurons. See the section on subgroups below.
Returns the array of values for state variable var, with length the number of neurons in the group.
Sets the neuron state values at rest for their differential equations.
The following usages are also possible for a group G:
Subgroups
A subgroup is a view on a group. It isn’t a new group, it’s just a convenient way of referring to a subset of the neurons in an already defined group. The subset has to be a continguous set of neurons. They can be overlapping if defined with the slice notation, or consecutive if defined with the subgroup() method. Subgroups can themselves be subgrouped. Subgroups can be used in almost all situations exactly as if they were groups, except that they cannot be passed to the Network object.
Details
TODO: details of other methods and properties for people wanting to write extensions?
Reset objects are called each network update step to reset specified state variables of neurons that have fired.
Resets specified state variable to a fixed value
Initialise as:
R = Reset([resetvalue=0*mvolt[, state=0]])
with arguments:
This will reset all of the neurons that have just spiked. The given state variable of the neuron group will be set to value resetvalue.
Reset defined by a string
Initialised with arguments:
Standard functions for expressions:
For example, these could be used to implement an adaptive model with random reset noise with the following string:
E -= 1*mV
V = Vr+rand()*5*mV
Resets specified state variable to the value of another state variable
Initialised with arguments:
This will reset all of the neurons that have just spiked. The given state variable of the neuron group will be set to the value of the state variable resetvaluestate.
Holds the state variable at the reset value for a fixed time after a spike.
Initialised with arguments:
Holds the state variable at the custom reset value for a fixed time after a spike.
Initialised as:
SimpleCustomRefractoriness(resetfunc[,period=5*ms[,state=0]])
with arguments:
The assumption is that resetfun(P, spikes) will reset the state variable state on the group P for the spikes with indices spikes. The values assigned by the custom reset function are stored by this object, and they are clamped at these values for period. This object does not introduce refractoriness for more than the one specified variable state or for spike indices other than those in the variable spikes passed to the custom reset function.
Holds the state variable at the custom reset value for a fixed time after a spike.
Initialised as:
CustomRefractoriness(resetfunc[,period=5*ms[,refracfunc=resetfunc]])
with arguments:
A reset with a user-defined function.
Initialised as:
FunReset(resetfun)
with argument:
Absence of reset mechanism.
Initialised as:
NoReset()
A threshold mechanism checks which neurons have fired a spike.
All neurons with a specified state variable above a fixed value fire a spike.
Initialised as:
Threshold([threshold=1*mV[,state=0])
with arguments:
Compilation
Note that if the global variable useweave is set to True then this function will use a C++ accelerated version which runs approximately 3x faster.
A threshold specified by a string expression.
Initialised with arguments:
Threshold mechanism where one state variable is compared to another.
Initialised as:
VariableThreshold([threshold_state=1[,state=0]])
with arguments:
If x is the value of state variable threshold_state on neuron i and y is the value of state variable state on neuron i then neuron i will fire if y>x.
Typically, using this class is more time efficient than writing a custom thresholding operation.
Compilation
Note that if the global variable useweave is set to True then this function will use a C++ accelerated version.
Empirical threshold, e.g. for Hodgkin-Huxley models.
In empirical models such as the Hodgkin-Huxley method, after a spike neurons are not instantaneously reset, but reset themselves as part of the dynamical equations defining their behaviour. This class can be used to model that. It is a simple threshold mechanism that checks e.g. V>=Vt but it only does so for neurons that haven’t recently fired (giving the dynamical equations time to reset the values naturally). It should be used in conjunction with the NoReset object.
Initialised as:
EmpiricalThreshold([threshold=1*mV[,refractory=1*ms[,state=0[,clock]]]])
with arguments:
Threshold mechanism with a user-specified function.
Initialised as:
FunThreshold(thresholdfun[,state=0])
with arguments:
Sample usage:
FunThreshold(lambda V:V>=Vt,state='V')
Threshold mechanism with a user-specified function.
Initialised as:
FunThreshold(thresholdfun)
where thresholdfun is a function with one argument, the 2d state value array, where each row is an array of values for one state, of length N for N the number of neurons in the group. For efficiency, data are numpy arrays and there is no unit checking.
Note: if you only need to consider one state variable, use the SimpleFunThreshold object instead.
No thresholding mechanism.
Initialised as:
NoThreshold()