model#

How to use model#

class DynapSEtorch.model.ADM(N: int, threshold_up: float, threshold_down: float, refractory: int)[source]#

Bases: Module

Adaptive Delta Modulation (ADM) module Converts an analog signal into UP and DOWN spikes using the Adaptive Delta Modulation scheme.

forward(input_signal)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

reconstruct(spikes, initial_value=0)[source]#

Reconstruct an analog signal based on the UP and DOWN spikes produced by the ADM module. Everytime the algorithm receives an UP/DOWN spike, the reconstructed signal is increment/decrement by the UP/DOWN threshold amount.

class DynapSEtorch.model.AdexLIF(num_neurons=1, input_per_synapse=[1, 1, 1, 1])[source]#

Bases: Module

class AdexLIFState(Isoma_mem, Isoma_ahp, refractory, Inmda, Iampa, Igaba_a, Igaba_b)#

Bases: tuple

Iampa#

Alias for field number 4

Igaba_a#

Alias for field number 5

Igaba_b#

Alias for field number 6

Inmda#

Alias for field number 3

Isoma_ahp#

Alias for field number 1

Isoma_mem#

Alias for field number 0

refractory#

Alias for field number 2

forward(input_nmda=None, input_ampa=None, input_gaba_a=None, input_gaba_b=None)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class DynapSEtorch.model.LIF(n_in, n_out, thr, tau, dt)[source]#

Bases: Module

class LIFState(V, S)#

Bases: tuple

S#

Alias for field number 1

V#

Alias for field number 0

forward(input)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.