Conformer
Conformer
Bases: Module
Conformer
class represents the Conformer
model which is a sequence-to-sequence model
used in some modern automated speech recognition systems. It is composed of several ConformerBlocks
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dim |
int
|
The number of expected features in the input. |
required |
n_layers |
int
|
The number of |
required |
n_heads |
int
|
The number of heads in the multiheaded self-attention mechanism in each |
required |
embedding_dim |
int
|
The dimension of the embeddings. |
required |
p_dropout |
float
|
The dropout probability to be used in each |
required |
kernel_size_conv_mod |
int
|
The size of the convolving kernel in the convolution module of each |
required |
with_ff |
bool
|
If True, each |
required |
Source code in models/tts/delightful_tts/attention/conformer.py
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
forward(x, mask, embeddings, encoding)
Forward Pass of the Conformer block.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Tensor
|
Input tensor of shape (batch_size, seq_len, num_features). |
required |
mask |
Tensor
|
The mask tensor. |
required |
embeddings |
Tensor
|
Embeddings tensor. |
required |
encoding |
Tensor
|
The positional encoding tensor. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tensor |
Tensor
|
The output tensor of shape (batch_size, seq_len, num_features). |
Source code in models/tts/delightful_tts/attention/conformer.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|