NeuronGroup
模型
神经元的定义是整个模拟的核心,神经元模型就是一组(一个或多个)方程(要求为差分方程形式)。模型方程描述的语法如下:
NeuronGroup class
(Shortest import: from brian2 import NeuronGroup)
-
class
-
Bases:
brian2.groups.group.Group
,brian2.core.spikesource.SpikeSource
A group of neurons.
Parameters: N : int
本组模拟中神经元的个数.
model : (str,
Equations
)The differential equations defining the group.
本组神经元的定义公式
使用例子:
method : (str, function), optional(可选择项)
The numerical integration method. Either a string with the name of a registered method (e.g. “euler”) or a function that receives an
Equations
object and returns the corresponding abstract code. If no method is specified, a suitable method will be chosen automatically.数值积分的方式,有:1.欧拉方法(euler),2. Heun方法(Heun),3.exact方法(exact)
threshold : str, optional
The condition which produces spikes. Should be a single line boolean expression.
使用例子:reset : str, optional
The (possibly multi-line) string with the code to execute on reset.
使用例子:refractory : {str,
Quantity
}, optionalEither the length of the refractory period (e.g.
2*ms
), a string expression that evaluates to the length of the refractory period after each spike (e.g.'(1 + rand())*ms'
), or a string expression evaluating to a boolean value, given the condition under which the neuron stays refractory after a spike (e.g.'v > -20*mV'
)
使用例子:events : dict, optional
User-defined events in addition to the “spike” event defined by the
threshold
. Has to be a mapping of strings (the event name) to strings (the condition) that will be checked.namespace: dict, optional :
A dictionary mapping identifier names to objects. If not given, the namespace will be filled in at the time of the call of
Network.run()
, with either the values from thenamespace
argument of theNetwork.run()
method or from the local context, if no such argument is given.dtype : (
dtype
,dict
), optionalThe
numpy.dtype
that will be used to store the values, or a dictionary specifying the type for variable names. If a value is not provided for a variable (or no value is provided at all), the preference setting core.default_float_dtype is used.
使用例子:codeobj_class : class, optional
The
CodeObject
class to run code with.
使用例子:dt :
Quantity
, optionalThe time step to be used for the simulation. Cannot be combined with the
clock
argument.
使用例子:clock :
Clock
, optionalThe update clock to be used. If neither a clock, nor the
dt
argument is specified, thedefaultclock
will be used.
使用例子:order : int, optional
The priority of of this group for operations occurring at the same time step and in the same scheduling slot. Defaults to 0.
使用例子:name : str, optional
A unique name for the group, otherwise use
neurongroup_0
, etc.
使用例子:
brian2.groups.neurongroup.
NeuronGroup
(
N,
model,
method=('exact',
'euler',
'heun'),
method_options=None,
threshold=None,
reset=None,
refractory=False,
events=None,
namespace=None,
dtype=None,
dt=None,
clock=None,
order=0,
name='neurongroup*',
codeobj_class=None
)
[source]