model.tools.layers.Pool#
- class Pool(pool_type: str, kernel_size: int = 2, stride: int | None = None)[source]#
Bases:
LayerGenPooling layer generator
Uses modules
torch.nn.AvgPool2d,torch.nn.MaxPool2d,SumPool2d.- Parameters:
pool_type (str) –
Pooling type.
A-torch.nn.AvgPool2d.M-torch.nn.MaxPool2d.S-SumPool2d.
kernel_size (int, optional) – The size of the window. Defaults to 2.
stride (Optional[int], optional) – The stride of the window. Default value is kernel_size.
- Raises:
ValueError – Non-existent pool type.
Methods
Initializes and returns the network layer