ConvTransposed
ConvTransposed
Bases: Module
ConvTransposed
applies a 1D convolution operation, with the main difference that it transposes the
last two dimensions of the input tensor before and after applying the BSConv1d
convolution operation.
This can be useful in certain architectures where the tensor dimensions are processed in a different order.
The ConvTransposed
class performs a BSConv
operation after transposing the input tensor dimensions. Specifically, it swaps the channels and width dimensions of a tensor, applies the convolution, and then swaps the dimensions back to their original order. The intuition behind swapping dimensions can depend on the specific use case in the larger architecture; typically, it's used when the operation or sequence of operations expected a different arrangement of dimensions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_channels |
int
|
Number of channels in the input |
required |
out_channels |
int
|
Number of channels produced by the convolution |
required |
kernel_size |
int
|
Size of the kernel used in convolution |
1
|
padding |
int
|
Zero-padding added around the input tensor along the width direction |
0
|
Attributes:
Name | Type | Description |
---|---|---|
conv |
BSConv1d
|
|
Source code in models/tts/delightful_tts/conv_blocks/conv_transposed.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
forward(x)
Forward propagation method for the ConvTransposed layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Tensor
|
input tensor |
required |
Returns:
Name | Type | Description |
---|---|---|
x |
Tensor
|
output tensor after application of ConvTransposed |
Source code in models/tts/delightful_tts/conv_blocks/conv_transposed.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|