SpikingMaxPooling2dLayer#

class sinabs.layers.SpikingMaxPooling2dLayer(pool_size: Union[numpy.ndarray, List, Tuple], strides: Optional[Union[numpy.ndarray, List, Tuple]] = None, padding: Union[numpy.ndarray, List, Tuple] = (0, 0, 0, 0))[source]#

Torch implementation of SpikingMaxPooling.

Parameters
  • pool_size (Union[numpy.ndarray, List, Tuple]) –

  • strides (Optional[Union[numpy.ndarray, List, Tuple]]) –

  • padding (Union[numpy.ndarray, List, Tuple]) –

forward(binary_input)[source]#

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_output_shape(input_shape: Tuple) Tuple[source]#

Returns the shape of output, given an input to this layer.

Parameters

input_shape (Tuple) – (channels, height, width)

Returns

(channelsOut, height_out, width_out)

Return type

Tuple