jaxsnn.discrete.topology.Topology

class jaxsnn.discrete.topology.Topology(time_steps: int = 100, dt: float = 1e-06, record_states: bool = False)

Bases: jaxsnn.base.topology.AbstractTopology[jaxsnn.base.topology.ModelInitFnT, jaxsnn.base.topology.ModelApplyFnT]

Represents a discrete-time spiking neural network (SNN) topology.

Manages the graph of layers, their connections, and the execution of the network simulation over discrete time steps.

Parameters
  • time_steps – Number of simulation time steps.

  • dt – Simulation time step size (in seconds).

  • record_states – Whether to record and return the full state history.

__init__(time_steps: int = 100, dt: float = 1e-06, record_states: bool = False)None

Initialize the discrete topology.

Parameters
  • time_steps – Number of simulation time steps.

  • dt – Simulation time step size (in seconds).

  • record_states – Whether to record and return the full state history.

Methods

__init__([time_steps, dt, record_states])

Initialize the discrete topology.

attach_layer_fns()

Attach functional closures (init/state/step) to each graph node.

generate_apply_fn(sccs_ordered)

Generate the model application (forward pass) function for the topology.

attach_layer_fns()None

Attach functional closures (init/state/step) to each graph node.

generate_apply_fn(sccs_ordered: List[Tuple[str, ]])Callable[[Dict[str, jax.Array], Dict[str, jax.Array]], Tuple[Optional[Dict[str, Optional[jaxsnn.base.types.BaseState, None]], None], Dict[str, jax.Array]]]

Generate the model application (forward pass) function for the topology.

Parameters

sccs_ordered – List of strongly connected components in topological order.

Returns

Model application function.