jaxsnn.event.stepping.step_existing_events
Classes
alias of |
|
alias of |
|
|
|
|
|
|
Functions
-
jaxsnn.event.stepping.step_existing_events.next_input(input_layers: List[str], spikes: Dict[str, jaxsnn.event.types.Spike], queue_heads: jax.Array, t: float, t_max: float) → Tuple[jax.Array, jax.Array, jaxsnn.event.types.Spike] Find the next input spike event across potentially multiple input layers.
-
jaxsnn.event.stepping.step_existing_events.replace(obj, /, **changes) Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@dataclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = replace(c, x=3) assert c1.x == 3 and c1.y == 2
-
jaxsnn.event.stepping.step_existing_events.step_existing(input_layers: List[str], dynamics: Callable, transition_fns: List[Callable], node: str, t_max: float, step_input: jaxsnn.event.types.Step) → Tuple[jaxsnn.event.types.Spike, jaxsnn.event.types.StepState, jax.Array, jax.Array] Simulate a single event-driven step for a spiking neuron layer using existing (from hardware) events.
Finds the next relevant spike (known hardware spike or input event), advances the neuron state to that event, applies the appropriate transition, and updates all event queues and indices accordingly.
- Parameters
input_layers – List of input layer names.
valid_input_layer_indices – Indices of valid input layers for event matching.
dynamics – Function describing the continuous neuron dynamics.
transition_fns – List of transition functions for each possible input.
node – Name of the current layer/node.
t_max – Maximum simulation time for this step.
step_input – Step object containing all state, parameters, queues, and indices.
- Returns
Tuple containing: - Spike: The spike event at this step (or empty if none). - StepState: Updated neuron state after the event. - QueueHead: Updated queue head indices for all inputs. - QueueIndex: Index of the input queue used for the event.