Labs · NIR

Inspecting a NIR graph.

The Neuromorphic Intermediate Representation (NIR) is a framework-neutral graph format for spiking neural networks. This lab reads one small example graph with nir-rs, a pure-Rust NIR implementation, compiled to WebAssembly without its native HDF5 reader.

IMPORTED · NIR structure

LIF layer with a leaky-integrator readout

This is imported graph structure, not a simulation. Nothing on this page runs neurons or produces spikes. The live Rust/WASM simulation on the homepage is a different network, built by synaptic-wiring and advanced by neuromod.

Example
Hand-authored example: three inputs, an affine projection into four LIF neurons, and a linear readout into two leaky integrators. Parameters are illustrative constants; nothing is trained or measured.
Origin
Hand-authored with the nir-rs graph API. Not trained, tuned, or measured.
Parsed by
nir-rs 0.4.5 with only its serde feature. The native hdf5 feature is not in the browser build.
Asset
lif-readout-example.v1.json · revision 1
Regenerate
cargo +1.98.1 test --manifest-path crates/neuromorphic-adapter/Cargo.toml --locked --features nir --test nir_example regenerate_nir_example -- --ignored --exact
NIR graph: LIF layer with a leaky-integrator readout 6 operators joined by 5 directed edges, from the input at the top to the output at the bottom. Each operator links to its details. input Input · shape 3 fc1 Affine · weight 4 × 3 lif1 LIF · tau 4 fc2 Linear · weight 2 × 4 li1 LI · tau 2 output Output · shape 2
Layers run top to bottom. Each box is one NIR operator; its second line is the operator type and its first field.

Static render of the build-time nir-rs projection. Interactive inspection loads when JavaScript and WebAssembly are available.

Edges

  1. input to fc1
  2. fc1 to lif1
  3. lif1 to fc2
  4. fc2 to li1
  5. li1 to output

Operators

Every operator, as nir-rs reads it.

Rendered at build time from the committed nir-rs projection. Field names are NIR wire names, and every value is formatted in Rust and shown as is.

  1. input

    Input

    Parameters
    Field dtype Shape Values
    shape usize 1 3
  2. fc1

    Affine

    Parameters
    Field dtype Shape Values
    weight f32 4 × 3 0.5, -0.25, 0, 0, 0.5, -0.25, -0.25, 0, 0.5, 0.25, 0.25, 0.25
    bias f32 4 0, 0, 0, 0.125
  3. lif1

    LIF

    Parameters
    Field dtype Shape Values
    tau f64 4 0.02, 0.02, 0.02, 0.02
    r f64 4 1, 1, 1, 1
    v_leak f64 4 0, 0, 0, 0
    v_threshold f64 4 1, 1, 1, 1
    v_reset f64 4 0, 0, 0, 0
  4. fc2

    Linear

    Parameters
    Field dtype Shape Values
    weight f32 2 × 4 1, 0, 1, 0, 0, 1, 0, 1
  5. li1

    LI

    Parameters
    Field dtype Shape Values
    tau f64 2 0.05, 0.05
    r f64 2 1, 1
    v_leak f64 2 0, 0
  6. output

    Output

    Parameters
    Field dtype Shape Values
    shape usize 1 2