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.GroupClass representing synaptic connections.
Creating a new
Synapsesobject does by default not create any synapses, you have to call theSynapses.connectmethod for that.Attributes
N_incoming_postThe number of incoming synapses for each neuron in the post-synaptic group. N_outgoing_preThe number of outgoing synapses for each neuron in the pre-synaptic group. _connect_calledremember whether connect was called to raise an error if an assignment to a synaptic variable is attempted without a preceding connect. _pathwaysList of all SynapticPathwayobjects_registered_variablesSet of Variableobjects that should be resized when the number of synapses changes_synaptic_updatersList of names of all updaters, e.g. delayThe 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_updaterPerforms numerical integration step subexpression_updaterUpdate 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.connecthas been called before setting a synaptic variable.connect([condition, i, j, p, n, …])Add synapses. register_variable(variable)Register a DynamicArrayto be automatically resized when the size of the indices change.unregister_variable(variable)Unregister a DynamicArrayfrom 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
SynapticPathwayobjects
-
_registered_variables¶ Set of
Variableobjects 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_runbefore the main simulation loop starts.
-
check_variable_write(variable)[source]¶ Checks that
Synapses.connecthas 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
DynamicArrayto be automatically resized when the size of the indices change. Called automatically when aSynapticArrayVariablespecifier is created.
-