hxtorch.spiking

Modules

hxtorch.spiking.backend

hxtorch.spiking.datasets

hxtorch.spiking.experiment

Defining basic types to create hw-executable instances

hxtorch.spiking.functional

hxtorch.spiking.handle

hxtorch.spiking.modules

hxtorch.spiking.observables

Hardware observables object

hxtorch.spiking.parameter

Generic parameter object holding hardware configurable neuron parameters.

hxtorch.spiking.run(experiment, runtime)

Execute the given experiment.

hxtorch.spiking.transforms

hxtorch.spiking.utils

Classes

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

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

BatchDropout(size, dropout, experiment)

Batch dropout layer

ConversionConfig(dt, calib_path, …)

Configuration for the conversion of NIRGraph to hxtorch SNN.

Experiment(*args, mock, dt, …)

Experiment class for describing experiments on hardware

HXModule(experiment, chip_coordinate, …)

PyTorch module supplying basic functionality for elements of SNNs that do have a representation on hardware

HXModuleWrapper(experiment, **modules)

Class to wrap HXModules

HXParameter(value)

HXTransformedModelParameter(model_value, …)

Handle(*args, **kwargs)

Factory for classes which are to be used as custom handles for observable data, depending on the specific observables a module deals with.

InputNeuron(*args, **kwargs)

Spike source generating spikes at the times given in the dense spike_times array binned with the time step of the experiment.

LI(size, experiment, leak, tau_mem, tau_syn, …)

Layer of leaky integrator neurons

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

Layer of leaky integrate-and-fire neurons.

LIFObservables

alias of types.Handle_current_membrane_cadc_membrane_madc_spikes

LIObservables

alias of types.Handle_current_membrane_cadc_membrane_madc

MixedHXModelParameter(model_value, …)

ModelParameter(model_value)

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

Neuron layer with exponential Euler integration scheme.

ReadoutNeuronExp(size, experiment, leak, …)

Neuron layer with exponential Euler integration scheme.

SparseSynapse(connections, experiment, …)

Sparse synapse layer

Synapse(in_features, out_features, …)

Synapse layer

SynapseHandle

alias of types.Handle_graded_spikes

TensorHandle

alias of types.Handle_tensor

TrainableHXParameter(value, set_on_hw_func)

TrainableHXTransformedModelParameter(…)

TrainableMixedHXModelParameter(model_value, …)

TrainableModelParameter(model_value, …)

Functions

hxtorch.spiking.from_nir(graph: nir.ir.graph.NIRGraph, cfg: hxtorch.spiking.utils.from_nir.ConversionConfig)torch.nn.modules.module.Module

Converts a NIRGraph to an hxtorch module.

Limitations

  • Only NIRGraphs with exactly one Input and one Output node

  • Only Linear, CubaLI, and CubaLIF nodes are supported

hxtorch.spiking.from_nir_data(nir_graph_data: nir.data_ir.graph.NIRGraphData, hxtorch_model)dict
hxtorch.spiking.run(experiment: hxtorch.spiking.experiment.Experiment, runtime: Optional[int, None])Optional

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.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.

hxtorch.spiking.to_nir_data(hxtorch_dict: dict, hxtorch_model)nir.data_ir.graph.NIRGraphData

hxtorch data comes as torch tensor of size (n_time_steps, batch_size, n_neurons)