Spiking Neural ODEs¶
Continuous-depth SNN layer combining adaptive ODE solvers with event-driven spike detection.
SpikingODELayer— Integrates LIF membrane ODE with adaptive Euler stepping. Detects threshold crossings via bisection for sub-timestep spike timing. Auto-shrinks step size near threshold, expands far from it. ~5x faster than fixed small-step integration.ODELIFDynamics— LIF membrane dynamics:dv/dt = -(v - v_rest) / tau_mem + I / C_mem. Configurable threshold, reset, time constant.
The intersection of Neural ODEs and SNNs. No other library has this as a reusable layer. (Reference: EventProp, Wunderlich & Pehle 2021)
from sc_neurocore.spike_ode import SpikingODELayer, ODELIFDynamics
See Tutorial 82: Spiking Neural ODEs for usage examples.
sc_neurocore.spike_ode.ode_layer
¶
Continuous-depth SNN layer combining ODE solver with spike events.
Solves the LIF membrane ODE continuously, detects threshold crossings as events, emits spikes, resets, continues. Adaptive step-size Euler with event detection.
The frontier intersection of Neural ODEs + SNNs. No library has this as a reusable layer.
Reference: EventProp (Wunderlich & Pehle 2021)
SpikingODELayer
¶
Spiking Neural ODE layer with event-driven integration.
Integrates the membrane ODE with adaptive Euler stepping. Detects threshold crossings via bisection, emits spikes, resets.
Parameters¶
n_inputs : int n_neurons : int dynamics : ODELIFDynamics dt_init : float Initial integration step size. dt_min : float Minimum step size. max_steps_per_interval : int Max ODE steps per simulation interval. seed : int
Source code in src/sc_neurocore/spike_ode/ode_layer.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
step(x, interval=1.0)
¶
Integrate ODE over one interval, return spike counts.
Parameters¶
x : ndarray of shape (n_inputs,) Input (constant over interval). interval : float Duration of this interval (ms).
Returns¶
ndarray of shape (n_neurons,) Spike count per neuron during interval.
Source code in src/sc_neurocore/spike_ode/ode_layer.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
forward(inputs, interval=1.0)
¶
Process a sequence of inputs.
Parameters¶
inputs : ndarray of shape (T, n_inputs) interval : float Duration per input step.
Returns¶
ndarray of shape (T, n_neurons), spike counts per interval
Source code in src/sc_neurocore/spike_ode/ode_layer.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
ODELIFDynamics
dataclass
¶
LIF membrane ODE dynamics.
dv/dt = -(v - v_rest) / tau_mem + I(t) / C_mem
Parameters¶
tau_mem : float Membrane time constant (ms). v_rest : float v_threshold : float v_reset : float C_mem : float Membrane capacitance (normalized).
Source code in src/sc_neurocore/spike_ode/ode_layer.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
dvdt(v, I)
¶
Compute membrane voltage derivative.
Source code in src/sc_neurocore/spike_ode/ode_layer.py
50 51 52 | |