hxtorch.spiking.functional.lif
Leaky-integrate and fire neurons
Classes
|
Parameters for CUBA LIF integration and backward path |
|
Typed version of namedtuple. |
|
Unterjubel hardware observables to allow correct gradient flow |
Functions
-
hxtorch.spiking.functional.lif.
cuba_lif_integration
(input: torch.Tensor, params: hxtorch.spiking.functional.lif.CUBALIFParams, hw_data: Optional[torch.Tensor] = None, dt: float = 1e-06) → Tuple[torch.Tensor, torch.Tensor] Leaky-integrate and fire neuron integration for realization of simple spiking neurons with exponential synapses. Integrates according to:
i^{t+1} = i^t * (1 - dt / au_{syn}) + x^t v^{t+1} = dt / au_{men} * (v_l - v^t + i^t) + v^t z^{t+1} = 1 if v^{t+1} > params.v_th v^{t+1} = params.v_reset if z^{t+1} == 1
Assumes i^0, v^0 = 0, v_leak :note: One dt synaptic delay between input and output
TODO: Issue 3992
- Parameters
input – Input spikes in shape (batch, time, neurons).
params – LIFParams object holding neuron parameters.
dt – Step width of integration.
- Returns
Returns the spike trains in shape and membrane trace as a tuple. Both tensors are of shape (batch, time, neurons).
-
hxtorch.spiking.functional.lif.
threshold
(input: torch.Tensor, method: str, alpha: float) → torch.Tensor Selection of the used threshold function. :param input: Input tensor to threshold function. :param method: The string indicator of the the threshold function.
Currently supported: ‘super_spike’.
- Parameters
alpha – Parameter controlling the slope of the surrogate derivative in case of ‘superspike’.
- Returns
Returns the tensor of the threshold function.