HDF5

HDF5 network exchange module.

class lava.lib.dl.netx.hdf5.Network(*args, **kwargs)

Generates a Lava process for the network described in hdf5 config.

Parameters
  • net_config (str) – name of the hdf5 config filename.

  • num_layers (int, optional) – number of blocks to generate. An integer valuew will only generate the first num_layers blocks in the description. The actual number of generated layers may be less than num_layers. If it is None, all the layers are generated. Defaults to None.

  • has_graded_input (bool, optional) – flag indicating the input spike type of input layer. Defaults to False.

__len__() int

Number of layers in the network.

__str__() str

Network description string.

static create_conv(layer_config: h5py._hl.group.Group, input_shape: Tuple[int, int, int], has_graded_input: bool = False) Tuple[lava.lib.dl.netx.blocks.process.Conv, str]

Creates conv layer from layer configuration

Parameters
  • layer_config (h5py.Group) – hdf5 handle to layer description.

  • input_shape (tuple of 3 ints) – shape of input to the block.

  • has_graded_input (bool, optional) – flag to indicate graded spikes at input, by default False.

Returns

  • AbstractProcess – dense block process.

  • str – table entry string for process.

static create_dense(layer_config: h5py._hl.group.Group, has_graded_input: bool = False) Tuple[lava.lib.dl.netx.blocks.process.Dense, str]

Creates dense layer from layer configuration

Parameters
  • layer_config (h5py.Group) – hdf5 handle to layer description.

  • has_graded_input (bool, optional) – flag to indicate graded spikes at input, by default False.

Returns

  • AbstractProcess – dense block process.

  • str – table entry string for process.

static create_input(layer_config: h5py._hl.group.Group) Tuple[lava.lib.dl.netx.blocks.process.Input, str]

Creates input layer from layer configuration.

Parameters

layer_config (h5py.Group) – hdf5 handle to layer description.

Returns

  • AbstractProcess – input block process.

  • str – table entry string for process.

static get_neuron_params(neuron_config: h5py._hl.group.Group, input: bool = False) lava.magma.core.process.process.AbstractProcess

Provides the correct neuron configuration process and parameters from the neuron description in hdf5 config.

Parameters
  • neuron_config (h5py.Group) – hdf5 object describing the neuron configuration

  • input (bool) – flag to indicate if the layer is input. For some cases special processing may be done.

Returns

The Lava process that implements the neuron described.

Return type

AbstractProcess

class lava.lib.dl.netx.hdf5.PyNetworkModel(proc: lava.magma.core.process.process.AbstractProcess)
implements_process

alias of lava.lib.dl.netx.hdf5.Network

implements_protocol

alias of lava.magma.core.sync.protocols.loihi_protocol.LoihiProtocol