Shortcuts

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, or None which means the size will be the same as that of the input.

  • kernel_size (int) – Temporal kernel size to use for forward_step and forward_steps.

  • temporal_fill (PaddingMode) – How temporal states are initialized.

Shape:
  • Input: (N,C,Hin,Win)(N, C, H_{in}, W_{in}).

  • Output: (N,C,S0,S1,S2)(N, C, S_{0}, S_{1}, S_{2}), where S=output_sizeS=\text{output\_size}.

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))
Read the Docs v: latest
Versions
latest
stable
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.