Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

TransposedConv1D

@frozen
public struct TransposedConv1D<Scalar> : Layer where Scalar : TensorFlowFloatingPoint

A 1-D transposed convolution layer (e.g. temporal transposed convolution over images).

This layer creates a convolution filter that is transpose-convolved with the layer input to produce a tensor of outputs.

  • The 1-D convolution kernel.

    Declaration

    public var filter: Tensor<Scalar>
  • The bias vector.

    Declaration

    public var bias: Tensor<Scalar>
  • The element-wise activation function.

    Declaration

    @noDerivative
    public let activation: Activation
  • The strides of the sliding window for spatial dimensions.

    Declaration

    @noDerivative
    public let stride: Int
  • The padding algorithm for convolution.

    Declaration

    @noDerivative
    public let padding: Padding
  • The paddingIndex property allows us to handle computation based on padding.

    Declaration

    @noDerivative
    public let paddingIndex: Int
  • The element-wise activation function type.

    Declaration

    public typealias Activation = (Tensor<Scalar>) -> Tensor<Scalar>
  • Creates a TransposedConv1D layer with the specified filter, bias, activation function, strides, and padding.

    Declaration

    public init(
      filter: Tensor<Scalar>,
      bias: Tensor<Scalar>? = nil,
      activation: @escaping Activation = identity,
      stride: Int = 1,
      padding: Padding = .valid
    )

    Parameters

    filter

    The 3-D convolution kernel.

    bias

    The bias vector.

    activation

    The element-wise activation function.

    strides

    The strides of the sliding window for spatial dimensions.

    padding

    The padding algorithm for convolution.

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

    Declaration

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

    Parameters

    input

    The input to the layer.

    Return Value

    The output.

  • Creates a TransposedConv1D layer with the specified filter shape, strides, padding, and element-wise activation function. The filter tensor is initialized using Glorot uniform initialization with the specified generator. The bias vector is initialized with zeros.

    Declaration

    public init(
      filterShape: (Int, Int, Int),
      stride: Int = 1,
      padding: Padding = .valid,
      activation: @escaping Activation = identity,
      useBias: Bool = true,
      filterInitializer: ParameterInitializer<Scalar> = glorotUniform(),
      biasInitializer: ParameterInitializer<Scalar> = zeros()
    )

    Parameters

    filterShape

    The shape of the 3-D convolution kernel.

    strides

    The strides of the sliding window for spatial dimensions.

    padding

    The padding algorithm for convolution.

    activation

    The element-wise activation function.

    generator

    The random number generator for initialization.