AvgPool3D

neuralpy.layers.pooling.AvgPool3D(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, name=None)
info

AvgPool3D Layer is mostly stable and can be used for any project. In the future, any chance of breaking changes is very low.

AvgPool3D Applies a 3D avg pooling over an input.

To learn more about AvgPool3D layers, please check PyTorch documentation

Supported Arguments:

  • kernel_size: (Integer | Tuple) Kernel size of the layer
  • stride=None: (Integer | Tuple) Stride for the conv.
  • padding=0: (Integer | Tuple) Padding for the conv layer.
  • ceil_mode=False: (Boolean) When True, will use ceil instead of floor to compute the output shape
  • count_include_pad=True: (Boolean) When True, will include the zero-padding in the averaging calculation
  • name=None: (String) Name of the layer, if not provided then automatically calculates a unique name for the layer

Example Code

from neuralpy.models import Sequential
from neuralpy.layers.pooling import AvgPool3D
from neuralpy.layers.convolutional import Conv2D
# Making the model
model = Sequential()
model.add(Conv3D(filters=8, kernel_size=3, input_shape=(1, 28, 28, 28), stride=1, name="first cnn"))
model.add(AvgPool3D(kernel_size=3, stride=3, padding=0, ceil_mode=False, count_include_pad=True, name="Pool Layer"))