Convolution2D
public struct Convolution2D<Element, Device> : LayerType, Codable where Element : RandomizableType, Device : DeviceType
A 2D convolutional layer
-
Declaration
Swift
public var parameterPaths: [WritableKeyPath<`Self`, Tensor<Element, Device>>] { get } -
Convolution filters, shape [outputChannels, inputChannels, kernelHeight, kernelWidth]
Declaration
Swift
public var filters: Tensor<Element, Device> -
Bias, shape [1, outputChannels, 1, 1]
Declaration
Swift
public var bias: Tensor<Element, Device> -
Undocumented
Declaration
Swift
public let stride: Int -
Undocumented
Declaration
Swift
public let padding: Int? -
Declaration
Swift
public var parameters: [Tensor<Element, Device>] { get } -
Creates a 2D convolutional layer.
The inputs of the layer must have a shape [batchSize, channels, height, width]
Declaration
Swift
public init(inputChannels: Int, outputChannels: Int, kernelSize: (width: Int, height: Int), padding: Int? = nil, stride: Int = 1)Parameters
inputChannelsNumber of channels in the input
outputChannelsNumber of channels in the output
kernelSizeWidth and height of the convolution kernel
paddingPadding, that will be applied around the edges of the input
strideStride, with which the convolution kernel is moved over the input tensor, >= 1.
View on GitHub
Convolution2D Structure Reference