AvgPool2D

@frozen
public struct AvgPool2D<Scalar> : ParameterlessLayer where Scalar : TensorFlowFloatingPoint

An average pooling layer for spatial data.

  • Declaration

    public typealias TangentVector = EmptyTangentVector
  • The size of the sliding reduction window for pooling.

    Declaration

    @noDerivative
    public let poolSize: (Int, Int, Int, Int)
  • The strides of the sliding window for each dimension of a 4-D input. Strides in non-spatial dimensions must be 1.

    Declaration

    @noDerivative
    public let strides: (Int, Int, Int, Int)
  • The padding algorithm for pooling.

    Declaration

    @noDerivative
    public let padding: Padding
  • Creates an average pooling layer.

    Declaration

    public init(poolSize: (Int, Int, Int, Int), strides: (Int, Int, Int, Int), padding: Padding)
  • Returns the output obtained from applying the layer to the given input.

    Declaration

    @differentiable
    public func forward(_ input: Tensor<Scalar>) -> Tensor<Scalar>

    Parameters

    input

    The input to the layer.

    Return Value

    The output.

  • Creates an average pooling layer.

    Declaration

    public init(poolSize: (Int, Int), strides: (Int, Int), padding: Padding = .valid)

    Parameters

    poolSize

    Vertical and horizontal factors by which to downscale.

    strides

    The strides.

    padding

    The padding.