Synapses class¶
(Shortest import: from brian2 import Synapses)
-
class
brian2.synapses.synapses.
Synapses
(source, target=None, model=None, on_pre=None, pre=None, on_post=None, post=None, connect=None, delay=None, on_event='spike', multisynaptic_index=None, namespace=None, dtype=None, codeobj_class=None, dt=None, clock=None, order=0, method=('exact', 'euler', 'heun'), method_options=None, name='synapses*')[source]¶ Bases:
brian2.groups.group.Group
Class representing synaptic connections.
Creating a new
Synapses
object does by default not create any synapses, you have to call theSynapses.connect
method for that.Attributes
N_incoming_post
The number of incoming synapses for each neuron in the post-synaptic group. N_outgoing_pre
The number of outgoing synapses for each neuron in the pre-synaptic group. _connect_called
remember whether connect was called to raise an error if an assignment to a synaptic variable is attempted without a preceding connect. _pathways
List of all SynapticPathway
objects_registered_variables
Set of Variable
objects that should be resized when the number of synapses changes_synaptic_updaters
List of names of all updaters, e.g. delay
The presynaptic delay (if a pre-synaptic pathway exists). delay_
The presynaptic delay without unit information (if apre-synaptic pathway exists). events
“Events” for all the pathways state_updater
Performs numerical integration step subexpression_updater
Update the “constant over a time step” subexpressions summed_updaters
“Summed variable” mechanism – sum over all synapses of a pre-/postsynaptic target Methods
before_run
(run_namespace)Optional method to prepare the object before a run. check_variable_write
(variable)Checks that Synapses.connect
has been called before setting a synaptic variable.connect
([condition, i, j, p, n, …])Add synapses. register_variable
(variable)Register a DynamicArray
to be automatically resized when the size of the indices change.unregister_variable
(variable)Unregister a DynamicArray
from the automatic resizing mechanism.verify_dependencies
(eq, eq_type, deps, …)Helper function to verify that event-driven equations do not depend on clock-driven equations and the other way round. Details
-
N_incoming_post
¶ The number of incoming synapses for each neuron in the post-synaptic group.
-
N_outgoing_pre
¶ The number of outgoing synapses for each neuron in the pre-synaptic group.
-
_connect_called
¶ remember whether connect was called to raise an error if an assignment to a synaptic variable is attempted without a preceding connect.
-
_pathways
¶ List of all
SynapticPathway
objects
-
_registered_variables
¶ Set of
Variable
objects that should be resized when the number of synapses changes
-
_synaptic_updaters
¶ List of names of all updaters, e.g. [‘pre’, ‘post’]
-
delay
¶ The presynaptic delay (if a pre-synaptic pathway exists).
-
delay_
¶ The presynaptic delay without unit information (if apre-synaptic pathway exists).
-
events
¶ “Events” for all the pathways
-
state_updater
¶ Performs numerical integration step
-
subexpression_updater
¶ Update the “constant over a time step” subexpressions
-
summed_updaters
¶ “Summed variable” mechanism – sum over all synapses of a pre-/postsynaptic target
-
before_run
(run_namespace)[source]¶ Optional method to prepare the object before a run.
Called by
Network.after_run
before the main simulation loop starts.
-
check_variable_write
(variable)[source]¶ Checks that
Synapses.connect
has been called before setting a synaptic variable.
-
connect
(condition=None, i=None, j=None, p=1.0, n=1, skip_if_invalid=False, namespace=None, level=0)[source]¶ Add synapses.
See Synapses for details.
-
register_variable
(variable)[source]¶ Register a
DynamicArray
to be automatically resized when the size of the indices change. Called automatically when aSynapticArrayVariable
specifier is created.
-