Have a question? Connect with the community at the TensorFlow Forum

# TransposedConv3D

``````@frozen
public struct TransposedConv3D<Scalar> : Layer where Scalar : TensorFlowFloatingPoint``````

A 3-D transposed convolution layer (e.g. spatial transposed convolution over images).

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

• ``` filter ```

The 5-D convolution kernel.

#### Declaration

``public var filter: Tensor<Scalar>``
• ``` bias ```

The bias vector.

#### Declaration

``public var bias: Tensor<Scalar>``
• ``` activation ```

The element-wise activation function.

#### Declaration

``````@noDerivative
public let activation: Activation``````
• ``` strides ```

The strides of the sliding window for spatial dimensions.

#### Declaration

``````@noDerivative
public let strides: (Int, Int, Int)``````
• ``` padding ```

The padding algorithm for convolution.

#### Declaration

``````@noDerivative
public let padding: Padding``````
• ``` paddingIndex ```

The paddingIndex property allows us to handle computation based on padding.

#### Declaration

``````@noDerivative
public let paddingIndex: Int``````
• ``` Activation ```

The element-wise activation function type.

#### Declaration

``public typealias Activation = @differentiable (Tensor<Scalar>) -> Tensor<Scalar>``
• ``` init(filter:bias:activation:strides:padding:) ```

Creates a `TransposedConv3D` 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,
strides: (Int, Int, Int) = (1, 1, 1),
padding: Padding = .valid
)``````

#### Parameters

 ``` filter ``` The 5-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.
• ``` forward(_:) ```

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

#### Declaration

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

#### Parameters

 ``` input ``` The input to the layer.

#### Return Value

The output.

• ``` init(filterShape:strides:padding:activation:useBias:filterInitializer:biasInitializer:) ```

Creates a `TransposedConv3D` 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, Int, Int),
strides: (Int, Int, Int) = (1, 1, 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 5-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.