pysnn.utils
pysnn.utils¶
-
pysnn.utils.
conv2d_output_shape
(h_in, w_in, kernel_size, stride=1, padding=0, dilation=1)¶ Determine output shape after a 2D convolutional layer.
- Parameters
h_in – Height of input image.
w_in – Width of input image.
kernel_size – Dimensions of the convolutional kernel.
stride – Stride of convolutional operation.
padding – Padding of convolutional operation.
dilation – Dilation of convolutional operation.
- Returns
(Height, Width) of output image.
-
pysnn.utils.
interspike_time
(spike_array)¶ Determine number of timesteps between all consecutive spikes.
- Parameters
spike_array – 1 dimensional spike array
- Returns
array with the time between all consecutive spikes.
-
pysnn.utils.
tensor_clamp
(tensor, min, max)¶ Clamp tensor with a separate value for each element in the input tensor.
- Parameters
tensor – Tensor to clamp.
min –
Tensor
containing minimum value for each element.max –
Tensor
containing maximum value for each element.
- Returns
Clamped input
Tensor
.