Residual block class#

class src.model.SpikingBlock.SpikingResConv2dBlock(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, spike_fn: SuperSpike | SigmoidDerivative | PiecewiseLinear | ATan, neuron_model: str, neuron_parameters: dict, weight_init: dict, scale_flag: bool, scale_factor: float, bn_flag: bool, dropout_flag: bool, dropout_p: float, residual_skip_connection_type: str, device, dtype: dtype, layer_index: int)#

Bases: Module

Class that implements the SNN spiking residual 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.

spk_res_skip_connection(output_spikes_records, identity)#
training: bool#