Pooling Layers#
Classes#
- class AdaptivePool(shape, shapes, *, channels=True, mode='average', **kwargs)[source]#
Bases:
BaseSingleLayerUses pooling to downscale the input to the desired shape.
- Attributes:
- group
int Layer group, if 0 it will always be used, else it will only be used if its group matches the Networks
- description
str Description of the layer
- layers
Sequential Layers to loop through in the forward pass
- group
- Parameters:
- shape
int|list[int] Output shape of the layer
- shapes
list[list[int]] Shape of the outputs from each layer
- channelsbool,
Optional If the input includes a channels dimension, default = True
- mode{‘average’, ‘max’}
Whether to use ‘max’ or ‘average’ pooling
- **kwargs
Leftover parameters to pass to base layer for checking
- shape
- class Pool(shapes, *, kernel=2, stride=2, padding=0, mode='max', pool_kwargs=None, **kwargs)[source]#
Bases:
BaseSingleLayerConstructs a max or average pooling layer.
Supports 1D, 2D, and 3D pooling.
- Attributes:
- group
int Layer group, if 0 it will always be used, else it will only be used if its group matches the Networks
- description
str Description of the layer
- layers
Sequential Layers to loop through in the forward pass
- group
- Parameters:
- shapes
list[list[int]] Shape of the outputs from each layer
- kernel
int|list[int],Optional Size of the kernel, default = 2
- stride
int|list[int],Optional Stride of the kernel, default = 2
- padding
int| {‘same’} |list[int],Optional Input padding, can an int or ‘same’ where ‘same’ preserves the input shape, default = 0
- mode{‘max’, ‘average’}
Whether to use ‘max’ or ‘average’ pooling
- pool_kwargs
dict[str,Any] |NoneType,Optional Additional keyword arguments to pass to the pooling layer
- **kwargs
Leftover parameters to pass to base layer for checking
- shapes
- class PoolDownscale(scale, shapes, *, mode='max', **kwargs)[source]#
Bases:
PoolDownscales the input using pooling.
Supports 1D, 2D, and 3D pooling.
- Attributes:
- group
int Layer group, if 0 it will always be used, else it will only be used if its group matches the Networks
- description
str Description of the layer
- layers
Sequential Layers to loop through in the forward pass
- group