TransposedConvolution2D

public struct TransposedConvolution2D<Element, Device> : LayerType, Codable where Element : RandomizableType, Device : DeviceType

A 2D transposed (fractionally strided) 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 vector, shape [1, outputChannels, 1, 1]

    Declaration

    Swift

    public var bias: Tensor<Element, Device>
  • Stride fraction >= 1

    Declaration

    Swift

    public let stride: Int
  • Number of elements that are removed from the edges of the output.

    Declaration

    Swift

    public let inset: Int?
  • Declaration

    Swift

    public var parameters: [Tensor<Element, Device>] { get }
  • Creates a 2D transposed (fractionally strided) 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), inset: Int? = nil, stride: Int = 1)

    Parameters

    inputChannels

    Number of channels in the input

    outputChannels

    Number of channels in the output

    kernelSize

    Width and height of the convolution kernel

    inset

    Number of elements that are removed from the edges of the output.

    stride

    Inverse of stride, with which the convolution kernel is moved over the input tensor, >= 1.

  • Declaration

    Swift

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