Convolutional block class#

Convolutional Spiking block class#

class src.model.SpikingBlock.SpikingConv2dBlock(input_dim: int, output_dim: int, input_channels: int, output_channels: int, kernel_size: Tuple[int, int], stride: Tuple[int, int], padding: Tuple[int, int], dilation: Tuple[int, int], bias: bool, padding_mode: str, pooling_flag: bool, pooling_type: str, pooling_stride: tuple | None, pooling_padding: tuple | None, nb_steps: int, truncated_bptt_ratio: int, spike_fn: SuperSpike | SigmoidDerivative | PiecewiseLinear | ATan, neuron_model: str, neuron_parameters: dict, weight_init: dict, upsample_flag: bool, upsample_mode: str, scale_flag: bool, scale_factor: float, bn_flag: bool, dropout_flag: bool, dropout_p: float, device, dtype: dtype, layer_index: int)#

Bases: Module

Class that implements the SNN spiking convolutional block.

forward(x: Tensor) Tuple[Tensor, Tensor]#

Method that defines the performed computation during the forward pass.

init_neuron_parameters(neuron_parameters: dict)#

Method that handles the spiking neurons parameters' initialization.

Parameters:

neuron_parameters (dict) -- Initialization specifications' dictionary.

init_recurrent_weights(weight_init: dict)#

Method that handles the recurrent parameters' initialization.

Parameters:

weight_init (dict) -- Initialization specifications' dictionary.

init_weights(weight_init: dict)#

Method that handles the convolution parameters' initialization.

Parameters:

weight_init (dict) -- Initialization specifications' dictionary.

training: bool#

Convolutional Readout block class#

class src.model.SpikingBlock.ReadoutConv2dBlock(input_dim: int, output_dim: int, input_channels: int, output_channels: int, kernel_size: Tuple[int, int], stride: Tuple[int, int], padding: Tuple[int, int], dilation: Tuple[int, int], bias: bool, padding_mode: str, nb_steps: int, truncated_bptt_ratio: int, neuron_model: str, neuron_parameters: dict, weight_init: dict, upsample_flag: bool, upsample_mode: str, scale_flag: bool, scale_factor: float, device, dtype: dtype, layer_index: int)#

Bases: Module

Class that implements the SNN readout convolutional block.

forward(x: Tensor)#

Method that defines the performed computation during the forward pass.

init_neuron_parameters(neuron_parameters: dict)#

Method that handles the readout neurons parameters' initialization.

Parameters:

neuron_parameters (dict) -- Initialization specifications' dictionary.

init_weights(weight_init: dict)#

Method that handles the convolution parameters' initialization.

Parameters:

weight_init (dict) -- Initialization specifications' dictionary.

training: bool#