Class AdaptiveAvgPool2dLayer

java.lang.Object
smile.deep.layer.AdaptiveAvgPool2dLayer
All Implemented Interfaces:
Function<Tensor,Tensor>, Layer

public class AdaptiveAvgPool2dLayer extends Object implements Layer
An adaptive average pooling that reduces a tensor by combining cells. The output size should be specified and the stride and kernel-size are automatically selected to adapt to the needs.
  • Constructor Details

    • AdaptiveAvgPool2dLayer

      public AdaptiveAvgPool2dLayer(int size)
      Constructor.
      Parameters:
      size - the output size.
    • AdaptiveAvgPool2dLayer

      public AdaptiveAvgPool2dLayer(int height, int width)
      Constructor.
      Parameters:
      height - the output height.
      width - the output width.
  • Method Details

    • asTorch

      public org.bytedeco.pytorch.Module asTorch()
      Description copied from interface: Layer
      Returns the PyTorch Module object.
      Specified by:
      asTorch in interface Layer
      Returns:
      the PyTorch Module object.
    • forward

      public Tensor forward(Tensor input)
      Description copied from interface: Layer
      Forward propagation (or forward pass) through the layer.
      Specified by:
      forward in interface Layer
      Parameters:
      input - the input tensor.
      Returns:
      the output tensor.