TransposedConv1d

class TransposedConv1d<T : DType, V>(val inChannels: Int, val outChannels: Int, val kernelSize: Int, val stride: Int = 1, val padding: Int = 0, val outputPadding: Int = 0, val dilation: Int = 1, val groups: Int = 1, val bias: Boolean = true, val name: String = "TransposedConv1d", initWeights: Tensor<T, V>, initBias: Tensor<T, V>? = null, val trainable: Boolean = true) : Module<T, V> , ModuleParameters<T, V> (source)

1D Transposed Convolutional layer (also known as fractionally-strided convolution).

This layer is commonly used for upsampling in generative models, audio synthesis (e.g. BigVGAN, Voxtral codec), and decoder architectures.

Parameters

inChannels

Number of input channels

outChannels

Number of output channels

kernelSize

Size of the convolving kernel

stride

Stride of the convolution (default: 1)

padding

Padding added to both sides of the input (default: 0)

outputPadding

Additional size added to one side of the output (default: 0)

dilation

Spacing between kernel elements (default: 1)

groups

Number of blocked connections from input channels to output channels (default: 1)

bias

Whether to add a learnable bias to the output (default: true)

name

Name of the module

initWeights

Initial weights tensor

initBias

Initial bias tensor (if bias is true)

Constructors

Link copied to clipboard
constructor(inChannels: Int, outChannels: Int, kernelSize: Int, stride: Int = 1, padding: Int = 0, outputPadding: Int = 0, dilation: Int = 1, groups: Int = 1, bias: Boolean = true, name: String = "TransposedConv1d", initWeights: Tensor<T, V>, initBias: Tensor<T, V>? = null, trainable: Boolean = true)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val groups: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val modules: List<Module<T, V>>
Link copied to clipboard
open override val name: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val params: List<ModuleParameter<T, V>>

Parameters owned by this node (weights, biases, etc.).

Link copied to clipboard
val stride: Int
Link copied to clipboard

Functions

Link copied to clipboard
open override fun forward(input: Tensor<T, V>, ctx: ExecutionContext): Tensor<T, V>
Link copied to clipboard
fun outputSize(inputSize: Int): Int

Calculates the output size for a given input size and transposed convolution parameters.