Class AvgPool2dLayer

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

public class AvgPool2dLayer extends Object implements Layer
An average pooling layer that reduces a tensor by combining cells, and assigning the average value of the input cells to the output cell.
  • Constructor Details

    • AvgPool2dLayer

      public AvgPool2dLayer(int kernel)
      Constructor.
      Parameters:
      kernel - the window/kernel size.
    • AvgPool2dLayer

      public AvgPool2dLayer(int height, int width)
      Constructor.
      Parameters:
      height - the window/kernel height.
      width - the window/kernel 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.