PySNN Documentation

pysnn.functional

pysnn.functional

pysnn.functional.exponential_trace_update(trace, x, alpha_t, tau_t, dt)

Exponential change in cell’s trace based on current trace and incoming spikes x.

Trace updates are performed according to the following formula:

\[trace_{t+1} = trace_{t} + \frac{(-trace + alpha_{t} * x) dt}{tau_{t}}\]
Parameters
  • trace – Current trace

  • x – Incoming/presynaptic spikes

  • alpha_t – Scaling factor for spike influence on trace

  • tau_t – Trace decay time constant

  • dt – Duration of single timestep

Returns

New trace values

pysnn.functional.linear_trace_update(trace, x, alpha_t, trace_decay, dt)

Calculate change in cell’s trace based on a fixed decay factor and incoming spikes x.

Trace updates are performed according to the following formula:

\[trace_{t+1} = trace_{t} * tracedecay + alpha_{t} * x\]
Parameters
  • trace – Current trace

  • x – Incoming/presynaptic spikes

  • alpha_t – Scaling factor for spike influence on trace

  • trace_decay – Trace decay factor, should be < 1

  • dt – Duration of single timestep

Returns

New trace values

pysnn.functional.exponential_thresh_update(thresh, x, alpha_thresh, tau_thresh, dt)

Calculate change in cell’s threshold based on current threshold and incoming spikes x.

Threshold updates are performed according to the following formula:

\[trace_{t+1} = trace_{t} + \frac{(-trace + alpha_{t} * x) dt}{tau_{t}}\]
Parameters
  • trace – Current trace

  • x – Incoming/presynaptic spikes

  • alpha_t – Scaling factor for spike influence on trace

  • tau_t – Trace decay time constant

  • dt – Duration of single timestep

Returns

New threshold values

pysnn.functional.linear_thresh_update(thresh, x, alpha_thresh, thresh_decay, dt)

Calculate change in cell’s threshold based on a fixed decay factor and incoming spikes x.

Threshold updates are performed according to the following formula:

\[trace_{t+1} = trace_{t} * tracedecay + alpha_{t} * x\]
Parameters
  • trace – Current trace

  • x – Incoming/presynaptic spikes

  • alpha_t – Scaling factor for spike influence on trace

  • trace_decay – Trace decay factor, should be < 1

  • dt – Duration of single timestep

Returns

New threshold values

pysnn.functional.if_voltage_update(v_cur, v_in, alpha, refrac_counts)

Calculate change in cell’s voltage based on current and incoming voltage, no decay.

Parameters
  • v_cur – Current voltages

  • v_in – Incoming voltages

  • alpha – Incoming voltage scaling factor

  • refrac_counts – Number of timesteps left in refractory state for each Neuron

Returns

New voltages

pysnn.functional.lif_linear_voltage_update(v_cur, v_rest, v_in, alpha_v, v_decay, dt, refrac_counts)

Calculate change in cell’s voltage based on a linear relation between current and incoming voltage, with decay.

Voltage updates are performed according to the following formula:

\[trace_{t+1} = trace_{t} * tracedecay + alpha_{t} * x\]
Parameters
  • v_cur – Current voltages

  • v_rest – Resting voltages

  • v_in – Incoming voltages

  • alpha_v – Incoming voltage scaling factor

  • v_decay – Voltage decay factor, should be < 1

  • dt – Duration of single timestep

  • refrac_counts – Number of timesteps left in refractory state for each Neuron

Returns

New voltages

pysnn.functional.lif_exponential_voltage_update(v_cur, v_rest, v_in, alpha_v, tau_v, dt, refrac_counts)

Calculate change in cell’s voltage based on current and incoming voltage.

Voltage updates are performed according to the following formula:

\[trace_{t+1} = trace_{t} + \frac{(-trace + alpha_{t} * x) dt}{tau_{t}}\]
Parameters
  • v_cur – Current voltages

  • v_rest – Resting voltages

  • v_in – Incoming voltages

  • alpha_v – Incoming voltage scaling factor

  • tau_v – Voltage decay time constant

  • dt – Duration of single timestep

  • refrac_counts – Number of timesteps left in refractory state for each Neuron

Returns

New voltages

pysnn.functional.fede_voltage_update(v_cur, v_rest, v_in, alpha_v, tau_v, dt, refrac_counts, pre_trace)

Calculate change in cell’s voltage based on current voltage and input trace.

Defined in “Unsupervised Learning of a Hierarchical Spiking Neural Network for Optical Flow Estimation: From Events to Global Motion Perception - F.P. Valles, et al.”

Voltage updates are performed according to the following formula:

\[trace_{t+1} = trace_{t} + \frac{(-trace + alpha_{t} * (v_{in} - pretrace)) dt}{tau_{t}}\]
Parameters
  • v_cur – Current voltages

  • v_rest – Resting voltages

  • v_in – Incoming voltages

  • alpha_v – Incoming voltage scaling factor

  • tau_v – Voltage decay time constant

  • dt – Duration of single timestep

  • refrac_counts – Number of timesteps left in refractory state for each Neuron

Returns

New voltages