jaxsnn.event.utils.to_nir_data

Translate spikes from a jaxsnn spike representation to NIRGraphData.

Classes

EventData(idx, time, n_neurons, t_max)

Event-based data represented as a list of event indices and their corresponding timestamps.

NIRGraphData(nodes, …)

Dictionary of NIRNodeData where each entry represents a NIRNode of a corresponding NIRGraph with its observables.

NIRNodeData(observables, …)

Dictionary of EventData or TimeGriddedData where each entry represents an observable (e.g., spikes, voltages) of a corresponding NIRNode

Spike(time, idx, current, layer_idx, internal)

Topology(t_max, backprop_method, mock, …)

Represents a spiking neural network (SNN) topology as a directed graph of layers.

ValuedEventData(idx, time, n_neurons, t_max, …)

Valued event-based data as a list of event indices, event times and event values.

Functions

jaxsnn.event.utils.to_nir_data.to_nir_data(jaxsnn_dict: Dict[str, jaxsnn.event.types.Spike], topology: jaxsnn.event.topology.Topology, observables=('spikes'))nir.data_ir.graph.NIRGraphData

Convert a dict of Spikes (jax-snn representation) to NIRGraphData.

Parameters
  • jaxsnn_dict – Dictionary of Spike objects where each entry represents the spikes for a corresponding node of the jaxsnn_model. Empty events in jaxsnn are encoded by idx = -1 and time = 2 * t_max.

  • topology – jaxsnn Topology object.

  • observables – Observables to be converted, by default (‘spikes’,)