engine.synapse.STDP

Synapses with spike-timing-dependent plasticity (STDP).

class engine.synapse.STDP.STDPSynapse(tau_plus: float = 20.0, tau_minus: float = 20.0, mu_plus: float = 0.0, mu_minus: float = 0.0, alpha_plus: float = 0.01, alpha_minus: float = 0.01, **kwargs)

STDP synapse implementation.

All STDP attributes are initialized as 2D tensors covering the source and destination ensembles, to allow for easily implementable heterogeneity in synaptic properties.

STDP synapses own the following attributes, on top of those inherited from Synapse:

Parameters:
  • tau_plus (float or Tensor) – Time constant of potentiation STDP time window.

  • tau_minus (float or Tensor) – Time constant of depression STDP time window.

  • mu_plus (float or Tensor) – Positive dependence exponent (e.g., 1.0 for multiplicative STDP, 0.0 for additive STDP)

  • mu_minus (float or Tensor) – Negative dependence exponent (e.g., 1.0 for multiplicative STDP, 0.0 for additive STDP)

  • alpha_plus (float or Tensor) – Limit on magnitude of weight modification for positive spike time difference.

  • alpha_minus (float or Tensor) – Limit on magnitude of weight modification for negative spike time difference.

_config_props_: tuple[str] = ('weight_max', 'weight_min', 'delay_ms', 'tau_plus', 'tau_minus', 'mu_plus', 'mu_minus', 'alpha_plus', 'alpha_minus')

A list of configurable property names of the class that is set/read by the configuration API.

Each sub/super-class can define this and the properties are accumulated across all the sub/super-classes.

forward(data: Tensor) dict

Updates weights if need be, then calls the parent Synapse forward() method.

Parameters:

data (Tensor) – Source ensemble spike output to be processed by this STDP synapse.

Returns:

Dictionary containing weights, connections, and output for further processing.

Return type:

dict

update_weights() Tensor

STDP weight update implementation.

Returns:

2D tensor containing weight differences (dW).

Return type:

Tensor