MaxPool2D

public struct MaxPool2D<Element, Device> : LayerType, Codable where Element : NumericType, Device : DeviceType

A 2D max pooling layer

  • Declaration

    Swift

    public var parameterPaths: [WritableKeyPath<`Self`, Tensor<Element, Device>>] { get }
  • Declaration

    Swift

    public var parameters: [Tensor<Element, Device>] { get }
  • Pooling window size

    Declaration

    Swift

    public let windowSize: Int
  • Pooling window stride

    Declaration

    Swift

    public let stride: Int
  • Padding applied around the edges of the input of the layer.

    Declaration

    Swift

    public let padding: Int?
  • Creates a 2D max pooling layer.

    Declaration

    Swift

    public init(windowSize: Int = 2, stride: Int = 2, padding: Int? = nil)

    Parameters

    windowSize

    Size of the window

    stride

    Stride, with which the window moves over the input tensor >= 1.

    padding

    Padding applied around the edges of the input of the layer.

  • Declaration

    Swift

    public func callAsFunction(_ inputs: Tensor<Element, Device>) -> Tensor<Element, Device>