hxtorch.spiking.utils.to_nir

Translate an hxtorch SNN to a NIRGraph.

Classes

AELIF(size, experiment, leak, reset, …)

Layer of neurons with configurable dynamics up to adaptive exponential leaky integrate-and-fire complexity.

Experiment(mock, dt[, hw_routing_func])

Experiment class for describing experiments on hardware

SNN(dt, mock, device)

Base SNN class for to-NIR conversion.

Synapse(in_features, out_features, …)

Synapse layer

Functions

hxtorch.spiking.utils.to_nir.run(experiment: hxtorch.spiking.experiment.Experiment, runtime: Optional[int, None])Optional[hxtorch.spiking.execution_info.ExecutionInfo, None]

Execute the given experiment.

TODO: Why is this a standalone function?

Parameters
  • experiment – The experiment representing the computational graph to be executed on hardware and/or in software.

  • runtime – Only relevant for hardware experiments. Indicates the runtime resolved with experiment.dt.

hxtorch.spiking.utils.to_nir.to_nir(snn: hxtorch.spiking.utils.to_nir.SNN, input_sample)nir.ir.graph.NIRGraph

Convert a hxtorch SNN to a NIR graph.

Parameters
  • snn – The hxtorch SNN to convert, where snn.exp is the experiment object. Furthermore the SNN must use modules that are convertible to NIR (e.g. Synapse, AELIF).

  • input_sample – A single input sample to the SNN.