conv_transpose1d
→Tensorconv_transpose1d(x: Tensor, weight: Tensor, bias: Tensor | None = None, stride: int | tuple[int, ...] = 1, padding: int | tuple[int, ...] = 0, output_padding: int | tuple[int, ...] = 0, groups: int = 1, dilation: int | tuple[int, ...] = 1)Transposed 1-D convolution (a.k.a. "fractionally-strided" conv).
Often called "deconvolution" in the literature, but this is not
the mathematical inverse of conv1d — it is the gradient
operator of a forward convolution, used to map a low-resolution
feature map back to a higher-resolution one. The standard
upsampling primitive in 1-D decoder networks (autoencoders, TTS
vocoders, etc.).
Parameters
xTensor(N, C_in, L_in).weightTensor(C_in, C_out/groups, kL).biasTensor= None(C_out,). When None,
a zero bias is materialised internally (the engine op requires
an explicit bias tensor).strideint or tuple of int= 11).paddingint or tuple of int= 0output_paddingint or tuple of int= 0stride > 1.groupsint= 11-only in the engine path).dilationint or tuple of int= 1Returns
TensorOutput of shape (N, C_out, L_out) where
Notes
Conceptually, transposed convolution inserts stride - 1 zeros
between consecutive input samples and then runs a normal
convolution — hence the "fractional stride" name. In practice the
engine implements it as the matrix-transpose of the corresponding
forward conv, which avoids materialising the zero-stuffed buffer.
Checkerboard artifacts (regular high-frequency patterns) commonly
arise when kernel_size is not divisible by stride; an
alternative is conv1d after upsampling.
Examples
>>> import lucid
>>> from lucid.nn.functional import conv_transpose1d
>>> x = lucid.randn(1, 4, 10)
>>> w = lucid.randn(4, 2, 3) # (C_in, C_out, kL)
>>> y = conv_transpose1d(x, w, stride=2)
>>> y.shape
(1, 2, 21)