Embedding
Embedding
Bases: Module
Class represents a simple embedding layer but without any learning of the embeddings. The embeddings are initialized with random values and kept static throughout training (They are parameters, not model's state).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_embeddings |
int
|
Size of the dictionary of embeddings, typically size of the vocabulary. |
required |
embedding_dim |
int
|
The size of each embedding vector. |
required |
Returns:
Type | Description |
---|---|
torch.Tensor: An output tensor resulting from the lookup operation. |
Source code in models/tts/delightful_tts/acoustic_model/embedding.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 |
|
forward(idx)
Forward propagation for the Embedding implementation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
idx |
Tensor
|
A tensor containing the indices of the embeddings to be accessed. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
torch.Tensor: An output tensor resulting from the lookup operation. |
Source code in models/tts/delightful_tts/acoustic_model/embedding.py
27 28 29 30 31 32 33 34 35 36 |
|