Auto

Auto network generation module form network description. We support hdf5 network description for now. It is intended to load a model and perform fine tuning or use it as a pretrained feature extractor.

class lava.lib.dl.slayer.auto.SequentialNetwork(network_config, persistent_state=False, reduction=None, weight_norm=False, count_log=False)

Creates sequential network from hdf5 network description.

Parameters:
  • network_config (str) – name of network configuration description.

  • persistent_state (bool) – flag for persistent state. Defaults to False.

  • reduction (str or None) – Reduction of output spike. Options are ‘sum’ or ‘mean’. None means no reduction. Defaults to None.

  • weight_norm (bool) – flag to enable weight norm. Defaults to False.

  • count_log (bool) – flag to enable count statistics. Defaults to False.

Returns:

network module.

Return type:

torch module

average_block(layer_handle)
dense_block(layer_handle)
flatten_block(layer_handle)
forward(spike)
input_block(layer_handle)
read_block(layer_handle)
lava.lib.dl.slayer.auto.get_classes(neuron_type=None)

Maps slayer class from neuron type.

Parameters:

neuron_type (string) – neuron type description. None means cuba neuron. Defaults to None.

Returns:

neuron class and block class.

Return type:

neuron_class, block_class

lava.lib.dl.slayer.auto.get_neuron_params(neuron_handle, neuron_class)

Gets neuron parameters from the hdf5 description handle.

Parameters:
  • neuron_handle (hdf5 handle) – handle to hdf5 object that describes the neuron.

  • neuron_class (slayer.neuron.*) – neuron class type

Returns:

dictionary of neuron parameters.

Return type:

dict