Embeddings
FixedEmbedding
Bases: Module
Fixed Embedding class that creates a fixed embedding of a given maximum length and features.
Source code in models/tts/styledtts2/diffusion/embeddings.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
__init__(max_length, features)
Initialize the FixedEmbedding with a maximum length and features.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_length |
int
|
The maximum length of the embedding. |
required |
features |
int
|
The number of features of the embedding. |
required |
Source code in models/tts/styledtts2/diffusion/embeddings.py
90 91 92 93 94 95 96 97 98 99 |
|
forward(x)
Forward pass of the FixedEmbedding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Tensor
|
The input tensor. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tensor |
Tensor
|
The output tensor. |
Source code in models/tts/styledtts2/diffusion/embeddings.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
LearnedPositionalEmbedding
Bases: Module
Learned Positional Embedding class that creates a learned positional embedding of a given dimension. Used for continuous time.
Source code in models/tts/styledtts2/diffusion/embeddings.py
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 |
|
__init__(dim)
Initialize the LearnedPositionalEmbedding with a dimension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dim |
int
|
The dimension of the embedding. |
required |
Source code in models/tts/styledtts2/diffusion/embeddings.py
41 42 43 44 45 46 47 48 49 50 |
|
forward(x)
Forward pass of the LearnedPositionalEmbedding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Tensor
|
The input tensor. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tensor |
Tensor
|
The output tensor. |
Source code in models/tts/styledtts2/diffusion/embeddings.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
SinusoidalEmbedding
Bases: Module
Sinusoidal Embedding class that creates a sinusoidal embedding of a given dimension.
Source code in models/tts/styledtts2/diffusion/embeddings.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 |
|
__init__(dim)
Initialize the SinusoidalEmbedding with a dimension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dim |
int
|
The dimension of the embedding. |
required |
Source code in models/tts/styledtts2/diffusion/embeddings.py
11 12 13 14 15 16 17 18 |
|
forward(x)
Forward pass of the SinusoidalEmbedding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Tensor
|
The input tensor. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tensor |
Tensor
|
The output tensor. |
Source code in models/tts/styledtts2/diffusion/embeddings.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
TimePositionalEmbedding(dim, out_features)
Creates a time positional embedding of a given dimension and output features.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dim |
int
|
The dimension of the embedding. |
required |
out_features |
int
|
The number of output features. |
required |
Returns:
Type | Description |
---|---|
Module
|
nn.Module: The time positional embedding module. |
Source code in models/tts/styledtts2/diffusion/embeddings.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|