Synapses#

Submodules#

conex.behaviors.synapses.dendrites module#

Dendritic behaviors.

class conex.behaviors.synapses.dendrites.BaseDendriticInput(*args, current_coef=1, **kwargs)[source]#

Bases: Behavior

Base behavior for turning pre-synaptic spikes to post-synaptic current. It checks for excitatory/inhibitory attributes of pre-synaptic neurons and sets a coefficient accordingly.

Note: weights must be initialize by others behaviors.

Also, Spike Catcher paradigm should be added to synapse group. Connection type (Proximal, Distal, Apical) should be specified by the tag of the synapse. and Dendrite behavior of the neurons group should access the I of each synapse to apply them.

Parameters:

current_coef (float) – Scalar coefficient that multiplies weights.

initialize(synapse)[source]#

Sets the current_type to -1 if the pre-synaptic neurons are inhibitory.

Parameters:

current_coef (float) – Strength of the synapse.

calculate_input(synapse)[source]#
forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.dendrites.SparseDendriticInput(*args, current_coef=1, **kwargs)[source]#

Bases: BaseDendriticInput

Sparsely connected dendrite behavior. It checks for excitatory/inhibitory attributes of pre-synaptic neurons and sets a coefficient, accordingly.

Note: weights must be initialize by others behaviors.

Also, Spike Catcher paradigm should be added to synapse group. Connection type (Proximal, Distal, Apical) should be specified by the tag of the synapse. and Dendrite behavior of the neurons group should access the I of each synapse to apply them.

Parameters:

current_coef (float) – Scalar coefficient that multiplies weights.

initialize(synapse)[source]#

Sets the current_type to -1 if the pre-synaptic neurons are inhibitory.

Parameters:

current_coef (float) – Strength of the synapse.

calculate_input(synapse)[source]#
training: bool#
class conex.behaviors.synapses.dendrites.One2OneDendriticInput(*args, current_coef=1, **kwargs)[source]#

Bases: BaseDendriticInput

One 2 One connection dendrite behavior. It checks for excitatory/inhibitory attributes of pre-synaptic neurons and sets a coefficient, accordingly.

Note: weights must be initialize by others behaviors.

Also, Spike Catcher paradigm should be added to synapse group. Connection type (Proximal, Distal, Apical) should be specified by the tag of the synapse. and Dendrite behavior of the neurons group should access the I of each synapse to apply them.

Parameters:

current_coef (float) – Scalar coefficient that multiplies weights.

initialize(synapse)[source]#

Sets the current_type to -1 if the pre-synaptic neurons are inhibitory.

Parameters:

current_coef (float) – Strength of the synapse.

calculate_input(synapse)[source]#
training: bool#
class conex.behaviors.synapses.dendrites.SimpleDendriticInput(*args, current_coef=1, **kwargs)[source]#

Bases: BaseDendriticInput

Fully connected dendrite behavior. It checks for excitatory/inhibitory attributes of pre-synaptic neurons and sets a coefficient, accordingly.

Note: weights must be initialize by others behaviors.

Also, Spike Catcher paradigm should be added to synapse group. Connection type (Proximal, Distal, Apical) should be specified by the tag of the synapse. and Dendrite behavior of the neurons group should access the I of each synapse to apply them.

Parameters:

current_coef (float) – Scalar coefficient that multiplies weights.

initialize(synapse)[source]#

Sets the current_type to -1 if the pre-synaptic neurons are inhibitory.

Parameters:

current_coef (float) – Strength of the synapse.

calculate_input(synapse)[source]#
training: bool#
class conex.behaviors.synapses.dendrites.AveragePool2D(*args, current_coef=1, **kwargs)[source]#

Bases: BaseDendriticInput

Average Pooling on Source population spikes.

Note: Axon paradigm should be added to the neurons.

Connection type (Proximal, Distal, Apical) should be specified by the tag of the synapse. and Dendrite behavior of the neurons group should access the I of each synapse to apply them.

Parameters:

current_coef (float) – Scalar coefficient that multiplies weights.

initialize(synapse)[source]#

Sets the current_type to -1 if the pre-synaptic neurons are inhibitory.

Parameters:

current_coef (float) – Strength of the synapse.

calculate_input(synapse)[source]#
training: bool#
class conex.behaviors.synapses.dendrites.LateralDendriticInput(*args, current_coef=1, inhibitory=None, **kwargs)[source]#

Bases: BaseDendriticInput

Lateral dendrite behavior.

Note: weight shape = (1, 1, kernel_depth, kernel_height, kernel_width)

weights must be initialize by others behaviors. Also, Spike Catcher paradigm should be added to synapse group. Connection type (Proximal, Distal, Apical) should be specified by the tag of the synapse. and Dendrite behavior of the neurons group should access the I of each synapse to apply them.

Parameters:
  • current_coef (float) – Scalar coefficient that multiplies weights.

  • inhibitory (bool or None) – If None, connection type respect the NeuronGroup type. if True, the effect in inhibitory and False is excitatory.

initialize(synapse)[source]#

Sets the current_type to -1 if the pre-synaptic neurons are inhibitory.

Parameters:

current_coef (float) – Strength of the synapse.

calculate_input(synapse)[source]#
training: bool#
class conex.behaviors.synapses.dendrites.Conv2dDendriticInput(*args, current_coef=1, stride=1, padding=0, **kwargs)[source]#

Bases: BaseDendriticInput

2D convolutional dendrite behavior. It checks for excitatory/inhibitory attributes of pre-synaptic neurons and sets a coefficient, accordingly.

Note: Weight shape = (out_channel, in_channel, kernel_height, kernel_width)

weights must be initialize by others behaviors. Also, Spike Catcher paradigm should be added to synapse group. Connection type (Proximal, Distal, Apical) should be specified by the tag of the synapse. and Dendrite behavior of the neurons group should access the I of each synapse to apply them.

Parameters:
  • current_coef (float) – Scalar coefficient that multiplies weights.

  • stride (int) – Stride of the convolution. The default is 1.

  • padding (int) – Padding added to both sides of the input. The default is 0.

initialize(synapse)[source]#

Sets the current_type to -1 if the pre-synaptic neurons are inhibitory.

Parameters:

current_coef (float) – Strength of the synapse.

calculate_input(synapse)[source]#
training: bool#
class conex.behaviors.synapses.dendrites.Local2dDendriticInput(*args, current_coef=1, stride=1, padding=0, **kwargs)[source]#

Bases: BaseDendriticInput

2D local dendrite behavior. It checks for excitatory/inhibitory attributes of pre-synaptic neurons and sets a coefficient, accordingly.

Note: Weight shape = (out_channel, out_size, connection_size);

where out_size = out_height * out_width, and connection_size = input_channel * connection_height * connection_width. Kernel shape = (out_channel, out_height, out_width, in_channel, connection_height, connection_width) weights must be initialize by others behaviors. Also, Spike Catcher paradigm should be added to synapse group. Connection type (Proximal, Distal, Apical) should be specified by the tag of the synapse. and Dendrite behavior of the neurons group should access the I of each synapse to apply them.

Parameters:
  • current_coef (float) – Scalar coefficient that multiplies weights.

  • stride (int) – Stride of the convolution. The default is 1.

  • padding (int) – Padding added to both sides of the input. The default is 0.

initialize(synapse)[source]#

Sets the current_type to -1 if the pre-synaptic neurons are inhibitory.

Parameters:

current_coef (float) – Strength of the synapse.

calculate_input(synapse)[source]#
training: bool#

conex.behaviors.synapses.learning module#

Learning rules.

conex.behaviors.synapses.learning.soft_bound(w, w_min, w_max)[source]#
conex.behaviors.synapses.learning.hard_bound(w, w_min, w_max)[source]#
conex.behaviors.synapses.learning.no_bound(w, w_min, w_max)[source]#
class conex.behaviors.synapses.learning.BaseLearning(*args, **kwargs)[source]#

Bases: Behavior

compute_dw(synapse)[source]#
forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.learning.SimpleSTDP(a_plus, a_minus, *args, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: BaseLearning

Spike-Timing Dependent Plasticity (STDP) rule for simple connections.

Note: The implementation uses local variables (spike trace).

Parameters:
  • w_min (float) – Minimum for weights. The default is 0.0.

  • w_max (float) – Maximum for weights. The default is 1.0.

  • a_plus (float) – Coefficient for the positive weight change. The default is None.

  • a_minus (float) – Coefficient for the negative weight change. The default is None.

  • positive_bound (str or function) – Bounding mechanism for positive learning. Accepting “no_bound”, “hard_bound” and “soft_bound”. The default is “no_bound”. “weights”, “w_min” and “w_max” pass as arguments for a bounding function.

  • negative_bound (str or function) – Bounding mechanism for negative learning. Accepting “no_bound”, “hard_bound” and “soft_bound”. The default is “no_bound”. “weights”, “w_min” and “w_max” pass as arguments for a bounding function.

initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

compute_dw(synapse)[source]#
training: bool#
class conex.behaviors.synapses.learning.SparseSTDP(a_plus, a_minus, *args, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: SimpleSTDP

Spike-Timing Dependent Plasticity (STDP) rule for sparse connections.

Note: The implementation uses local variables (spike trace).

Parameters:
  • w_min (float) – Minimum for weights. The default is 0.0.

  • w_max (float) – Maximum for weights. The default is 1.0.

  • a_plus (float) – Coefficient for the positive weight change. The default is None.

  • a_minus (float) – Coefficient for the negative weight change. The default is None.

  • positive_bound (str or function) – Bounding mechanism for positive learning. Accepting “no_bound”, “hard_bound” and “soft_bound”. The default is “no_bound”. “weights”, “w_min” and “w_max” pass as arguments for a bounding function.

  • negative_bound (str or function) – Bounding mechanism for negative learning. Accepting “no_bound”, “hard_bound” and “soft_bound”. The default is “no_bound”. “weights”, “w_min” and “w_max” pass as arguments for a bounding function.

compute_dw(synapse)[source]#
forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.learning.One2OneSTDP(a_plus, a_minus, *args, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: SimpleSTDP

Spike-Timing Dependent Plasticity (STDP) rule for One 2 One connections.

Note: The implementation uses local variables (spike trace).

Parameters:
  • w_min (float) – Minimum for weights. The default is 0.0.

  • w_max (float) – Maximum for weights. The default is 1.0.

  • a_plus (float) – Coefficient for the positive weight change. The default is None.

  • a_minus (float) – Coefficient for the negative weight change. The default is None.

  • positive_bound (str or function) – Bounding mechanism for positive learning. Accepting “no_bound”, “hard_bound” and “soft_bound”. The default is “no_bound”. “weights”, “w_min” and “w_max” pass as arguments for a bounding function.

  • negative_bound (str or function) – Bounding mechanism for negative learning. Accepting “no_bound”, “hard_bound” and “soft_bound”. The default is “no_bound”. “weights”, “w_min” and “w_max” pass as arguments for a bounding function.

compute_dw(synapse)[source]#
training: bool#
class conex.behaviors.synapses.learning.SimpleiSTDP(*args, rho=None, alpha=None, lr=1e-05, is_inhibitory=True, **kwargs)[source]#

Bases: BaseLearning

Implementation of symmetric inhibitory Spike-Time Dependent Plasticity (iSTDP). DOI: 10.1126/science.1211095

Note: The implementation uses local variables (spike trace).

The implementation assumes that tau is in milliseconds.

Parameters:
  • lr (float) – Learning rate. The Default is 1e-5.

  • rho (float) – Constant that determines the fire rate of target neurons.

  • alpha (float) – Manual constant for target trace, which replace rho value.

initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

compute_dw(synapse)[source]#
training: bool#
class conex.behaviors.synapses.learning.One2OneiSTDP(*args, rho=None, alpha=None, lr=1e-05, is_inhibitory=True, **kwargs)[source]#

Bases: SimpleiSTDP

Implementation of symmetric inhibitory Spike-Time Dependent Plasticity (iSTDP) for One 2 One Connections. DOI: 10.1126/science.1211095

Note: The implementation uses local variables (spike trace).

The implementation assumes that tau is in milliseconds.

Parameters:
  • lr (float) – Learning rate. The Default is 1e-5.

  • rho (float) – Constant that determines the fire rate of target neurons.

  • alpha (float) – Manual constant for target trace, which replace rho value.

compute_dw(synapse)[source]#
training: bool#
class conex.behaviors.synapses.learning.SparseiSTDP(*args, rho=None, alpha=None, lr=1e-05, is_inhibitory=True, **kwargs)[source]#

Bases: SimpleiSTDP

Implementation of symmetric inhibitory Spike-Time Dependent Plasticity (iSTDP) for Sparse Connections. DOI: 10.1126/science.1211095

Note: The implementation uses local variables (spike trace).

The implementation assumes that tau is in milliseconds.

Parameters:
  • lr (float) – Learning rate. The Default is 1e-5.

  • rho (float) – Constant that determines the fire rate of target neurons.

  • alpha (float) – Manual constant for target trace, which replace rho value.

compute_dw(synapse)[source]#
forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.learning.Conv2dSTDP(a_plus, a_minus, *args, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: SimpleSTDP

Spike-Timing Dependent Plasticity (STDP) rule for 2D convolutional connections.

Note: The implementation uses local variables (spike trace).

Parameters:
  • a_plus (float) – Coefficient for the positive weight change. The default is None.

  • a_minus (float) – Coefficient for the negative weight change. The default is None.

initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

compute_dw(synapse)[source]#
training: bool#
class conex.behaviors.synapses.learning.Local2dSTDP(a_plus, a_minus, *args, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: SimpleSTDP

Spike-Timing Dependent Plasticity (STDP) rule for 2D local connections.

compute_dw(synapse)[source]#
training: bool#
class conex.behaviors.synapses.learning.SimpleRSTDP(a_plus, a_minus, tau_c, *args, init_c_mode=0, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: SimpleSTDP

Reward-modulated Spike-Timing Dependent Plasticity (RSTDP) rule for simple connections.

Note: The implementation uses local variables (spike trace).

Parameters:
  • a_plus (float) – Coefficient for the positive weight change. The default is None.

  • a_minus (float) – Coefficient for the negative weight change. The default is None.

  • tau_c (float) – Time constant for the eligibility trace. The default is None.

  • init_c_mode (int) – Initialization mode for the eligibility trace. The default is 0.

initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.learning.One2OneRSTDP(a_plus, a_minus, tau_c, *args, init_c_mode=0, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: One2OneSTDP, SimpleRSTDP

Reward-modulated Spike-Timing Dependent Plasticity (RSTDP) rule for One 2 One connections.

Note: The implementation uses local variables (spike trace).

Parameters:
  • a_plus (float) – Coefficient for the positive weight change. The default is None.

  • a_minus (float) – Coefficient for the negative weight change. The default is None.

  • tau_c (float) – Time constant for the eligibility trace. The default is None.

  • init_c_mode (int) – Initialization mode for the eligibility trace. The default is 0.

training: bool#
class conex.behaviors.synapses.learning.SparseRSTDP(a_plus, a_minus, tau_c, *args, init_c_mode=0, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: SparseSTDP

Reward-modulated Spike-Timing Dependent Plasticity (RSTDP) rule for sparse connections.

Note: The implementation uses local variables (spike trace).

Parameters:
  • a_plus (float) – Coefficient for the positive weight change. The default is None.

  • a_minus (float) – Coefficient for the negative weight change. The default is None.

  • tau_c (float) – Time constant for the eligibility trace. The default is None.

  • init_c_mode (int) – Initialization mode for the eligibility trace. The default is 0.

initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.learning.Conv2dRSTDP(a_plus, a_minus, tau_c, *args, init_c_mode=0, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: Conv2dSTDP, SimpleRSTDP

Reward-modulated Spike-Timing Dependent Plasticity (RSTDP) rule for 2D convolutional connections.

Note: The implementation uses local variables (spike trace).

Parameters:
  • a_plus (float) – Coefficient for the positive weight change. The default is None.

  • a_minus (float) – Coefficient for the negative weight change. The default is None.

  • tau_c (float) – Time constant for the eligibility trace. The default is None.

  • init_c_mode (int) – Initialization mode for the eligibility trace. The default is 0.

training: bool#
class conex.behaviors.synapses.learning.Local2dRSTDP(a_plus, a_minus, tau_c, *args, init_c_mode=0, w_min=0.0, w_max=1.0, positive_bound=None, negative_bound=None, **kwargs)[source]#

Bases: Local2dSTDP, SimpleRSTDP

Reward-modulated Spike-Timing Dependent Plasticity (RSTDP) rule for 2D local connections.

Note: The implementation uses local variables (spike trace).

Parameters:
  • a_plus (float) – Coefficient for the positive weight change. The default is None.

  • a_minus (float) – Coefficient for the negative weight change. The default is None.

  • tau_c (float) – Time constant for the eligibility trace. The default is None.

  • init_c_mode (int) – Initialization mode for the eligibility trace. The default is 0.

training: bool#

conex.behaviors.synapses.specs module#

Synapse-related behaviors.

class conex.behaviors.synapses.specs.SynapseInit(*args, **kwargs)[source]#

Bases: Behavior

This Behavior makes initial variable required for multiple behavior to use.

WARNING: src_delay and dst_delay have equal delay for all of their neurons. And should be initialized by other behaviors.

initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.specs.DelayInitializer(*args, mode=None, scale=1, offset=0, destination=False, delays=None, **kwargs)[source]#

Bases: Behavior

Initialize the delay of axon entering the synapse or the dendrite conveying current.

delays (Tensor(int), optional): a tensor of delay for each neuron of source or destination.

Parameters:
  • mode (str or number) – string should be torch functions that fills a tensor like: “random”, “normal”, “zeros”, “ones”, … . In number case the synapse delays will be filled with that number.

  • offset (int) – delay added to the all delays.

  • scale (int) – scales delay.

  • weights (tensor) – giving the delays directly.

  • destination (boolean) – True for destination neurons. defaults to False.

initialize(synapse)[source]#

Makes index for the Synapse delay.

Parameters:

synapses (SynapseGroup) – The synapses whose weight should be bound.

training: bool#
class conex.behaviors.synapses.specs.WeightInitializer(*args, mode=None, scale=1, offset=0, function=None, density=1, true_sparsity=True, weight_shape=None, kernel_shape=None, weights=None, **kwargs)[source]#

Bases: Behavior

Initialize the weights of synapse.

Note: Either mode or weights should be not None or else, the weight matrix will be None.

Parameters:
  • mode (str or number) – string should be torch functions that fills a tensor like: “random”, “normal”, “zeros”, “ones”, … . In number case the synapse weights will be filled with that number.

  • scale (float) – Scaling factor to apply on the weight.

  • offset (float) – An offset to add to the weight.

  • function (callable) – A function to apply on weight.

  • density (flaot) – The sparsity of weights. default is one.

  • true_sparsity (bool) – If false, weights are created but have zero value. Defaults to True.

  • weights (tensor) – Optional parameter to specify the weights matrix directly.

  • weight_shape (tuple) – Optional parameter to specify the shape of the weights tensor.

  • kernel_shape (tuple) – Optional parameter to specify the shape of the kernel.

initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.specs.WeightNormalization(*args, norm=1, **kwargs)[source]#

Bases: Behavior

This Behavior normalize weights in order to assure each destination neuron has sum of its weight equal to norm. Supporting Simple, Local2d, ‘Conv2d’.

Parameters:

norm (int) – Desired sum of weights for each neuron.

initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.specs.CurrentNormalization(*args, norm=1, **kwargs)[source]#

Bases: Behavior

This Behavior normalize Current in order to assure each destination neuron maximum input current is eight equal to norm. Supporting Simple, Local2d, ‘Conv2d’.

Parameters:

norm (int) – Desired maximum of current for each neuron.

initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.specs.WeightClip(*args, w_min=0, w_max=1, **kwargs)[source]#

Bases: Behavior

Clip the synaptic weights in a range.

Parameters:
  • w_min (float) – Minimum weight constraint.

  • w_max (float) – Maximum weight constraint.

initialize(synapse)[source]#

Set weight constraint attributes to the synapses.

Parameters:

synapses (SynapseGroup) – The synapses whose weight should be bound.

forward(synapses)[source]#

Clip the synaptic weights in each time step.

Parameters:

synapses (SynapseGroup) – The synapses whose weight should be bound.

training: bool#
class conex.behaviors.synapses.specs.PreSpikeCatcher(*args, **kwargs)[source]#

Bases: Behavior

Get the spikes from pre synaptic neuron group and set as src_spike attribute for the synapse group.

Note: Axon should be added to pre synaptice neuron group

initialize_last = True#
initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.specs.PostSpikeCatcher(*args, **kwargs)[source]#

Bases: Behavior

Get the spikes from post synaptic neuron group and set as dst_spike attribute for the synapse group.

Note: Axon should be added to post synaptice neuron group

initialize_last = True#
initialize(synapse)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

forward(synapse)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#
class conex.behaviors.synapses.specs.PreTrace(tau_s, *args, spike_scale=1.0, **kwargs)[source]#

Bases: Behavior

Calculates the pre synaptic spike trace.

Note : should be placed after spike catcher behavior.

Parameters:
  • tau_s (float) – decay term for spike trace. The default is None.

  • spike_scale (float) – the increase effect of spikes on the trace.

initialize(synapse)[source]#

Sets the trace attribute for the neural population.

forward(synapse)[source]#

Calculates the spike trace of each neuron by adding current spike and decaying the trace so far.

training: bool#
class conex.behaviors.synapses.specs.PostTrace(tau_s, *args, spike_scale=1.0, **kwargs)[source]#

Bases: Behavior

Calculates the post synaptic spike trace.

Note : should be placed after spike catcher behavior.

Parameters:
  • tau_s (float) – decay term for spike trace. The default is None.

  • spike_scale (float) – the increase effect of spikes on the trace.

initialize(synapse)[source]#

Sets the trace attribute for the neural population.

forward(synapse)[source]#

Calculates the spike trace of each neuron by adding current spike and decaying the trace so far.

training: bool#