AdaptiveMaxPool3d¶
- class continual.AdaptiveMaxPool3d(output_size, kernel_size, stride=1, padding=0, dilation=1, temporal_fill='zeros')[source]¶
Applies a Continual 3D adaptive max pooling over an input signal composed of several input planes.
The output is of size T x H x W, for any input size. The pooling over the T dimension is continual (progressively cached) and the other is regular. During continual inference, the temporal pooling size is determined by the
kernel_size
. The number of output features is equal to the number of input planes.- Parameters:
output_size (Union[int, None, Tuple[Optional[int], Optional[int], Optional[int]]]) – the target output size of the form T x H x W. Can be a tuple (T, H, W) or a single number T for a cube T x T x T. T, H and W can be either a
int
, orNone
which means the size will be the same as that of the input.kernel_size (int) – Temporal kernel size to use for
forward_step
andforward_steps
.temporal_fill (PaddingMode) – How temporal states are initialized.
- Shape:
Input: .
Output: , where .
Examples:
# target output size of 1x1x1 m = co.AdaptiveMaxPool3d((1, 1, 1), kernel_size=5) x = torch.randn(1, 64, 5, 16, 16) assert torch.allclose(m.forward(x), m.forward_steps(x))