module = nn.TemporalSubSampling(inputFrameSize, kW, [dW])

Applies a 1D sub-sampling over an input sequence composed of nInputFrame frames. The input tensor in forward(input) is expected to be a 2D tensor (inputFrameSize x nInputFrame). The output frame size will be the same as the input one (inputFrameSize).

The parameters are the following:

inputFrameSize
The input frame size expected in sequences given into forward().
kW
The kernel width of the sub-sampling
dW
The step of the sub-sampling. Default is 1.

Note that depending of the size of your kernel, several (of the last) frames of the sequence might be lost. It is up to the user to add proper padding frames in the input sequences.

If the input sequence is a 2D tensor inputFrameSize x nInputFrame, the output sequence will be inputFrameSize x nOutputFrame where

nOutputFrame = (nInputFrame - kW) / dW + 1

The parameters of the sub-sampling can be found in self.weight (Tensor of size inputFrameSize) and self.bias (Tensor of size inputFrameSize). The corresponding gradients can be found in self.gradWeight and self.gradBias.

The output value of the layer can be precisely described as:

output[i][t] = bias[i] + weight[i] * sum_{k=1}^kW input[i][dW*(t-1)+k)]