Pooling modules¶
PoolTranspose3d is the sparse inverse-resolution module. Calling it with
only a coarse tensor generates fine support; passing a second sparse tensor
uses that tensor as exact output support. Both routes average all valid coarse
contributors per output row.
TrilinearUpsample3d is a parameter-free interpolation module for generated
or caller-owned fine support.
- class torch_lattice.nn.modules.pooling.AvgPool3d(kernel_size=2, stride=2, padding=0, dilation=1)[source]¶
Bases:
Pool3d
- class torch_lattice.nn.modules.pooling.GlobalAvgPool(*args, **kwargs)[source]¶
Bases:
Module- forward(input, *, batch_size=None)[source]¶
Define 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Return type:
- Parameters:
input (SparseTensor)
batch_size (int | None)
- class torch_lattice.nn.modules.pooling.GlobalMaxPool(*args, **kwargs)[source]¶
Bases:
Module- forward(input, *, batch_size=None)[source]¶
Define 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Return type:
- Parameters:
input (SparseTensor)
batch_size (int | None)
- class torch_lattice.nn.modules.pooling.GlobalSumPool(*args, **kwargs)[source]¶
Bases:
Module- forward(input, *, batch_size=None)[source]¶
Define 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Return type:
- Parameters:
input (SparseTensor)
batch_size (int | None)
- class torch_lattice.nn.modules.pooling.MaxPool3d(kernel_size=2, stride=2, padding=0, dilation=1)[source]¶
Bases:
Pool3d
- class torch_lattice.nn.modules.pooling.Pool3d(*, mode, kernel_size=2, stride=2, padding=0, dilation=1)[source]¶
Bases:
ModuleLocal sparse 3D pooling over generated output support.
- Parameters:
mode (Literal['sum', 'max', 'avg'])
- forward(input)[source]¶
Define 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Return type:
- Parameters:
input (SparseTensor)
- class torch_lattice.nn.modules.pooling.PoolTranspose3d(kernel_size=2, stride=2, padding=0, dilation=1)[source]¶
Bases:
ModuleAverage-pooling transpose onto generated or explicit target support.
- forward(input, coordinates=None)[source]¶
Define 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Return type:
- Parameters:
input (SparseTensor)
coordinates (SparseTensor | None)
- class torch_lattice.nn.modules.pooling.SumPool3d(kernel_size=2, stride=2, padding=0, dilation=1)[source]¶
Bases:
Pool3d
- class torch_lattice.nn.modules.pooling.TrilinearUpsample3d(stride=2)[source]¶
Bases:
ModuleNormalized trilinear upsampling on generated or target support.
- forward(input, coordinates=None)[source]¶
Define 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Return type:
- Parameters:
input (SparseTensor)
coordinates (SparseTensor | None)