public struct MaxPool2D<Scalar> : Layer where Scalar : TensorFlowFloatingPoint

A max pooling layer for spatial data.

  • Creates a max pooling layer.

    Declaration

    public init(
        poolSize: (Int, Int, Int, Int),
        strides: (Int, Int, Int, Int),
        padding: Padding
    )
  • Creates a max 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.

  • Returns the output obtained from applying the layer to the given input.

    Declaration

    public func applied(to input: Tensor<Scalar>, in _: Context) -> Tensor<Scalar>

    Parameters

    input

    The input to the layer.

    context

    The contextual information for the layer application, e.g. the current learning phase.

    Return Value

    The output.