Class EmbeddingLayer
- Namespace
- NeuralNetworks.Layers
- Assembly
- NeuralNetworks.dll
Embedding layer that maps integer indices to dense vectors. Used in Word2Vec and other NLP models.
public class EmbeddingLayer : Layer<int[,], float[,]>
- Inheritance
-
EmbeddingLayer
- Inherited Members
Remarks
Initializes a new instance of the EmbeddingLayer class.
Constructors
EmbeddingLayer(int, int, ParamInitializer)
Embedding layer that maps integer indices to dense vectors. Used in Word2Vec and other NLP models.
public EmbeddingLayer(int vocabSize, int embeddingDim, ParamInitializer paramInitializer)
Parameters
vocabSizeintSize of the vocabulary (number of unique tokens).
embeddingDimintDimensionality of the embedding vectors.
paramInitializerParamInitializerInitializer for embedding weights.
Remarks
Initializes a new instance of the EmbeddingLayer class.
Methods
CreateOperationListBuilder()
public override OperationListBuilder<int[,], float[,]> CreateOperationListBuilder()
Returns
- OperationListBuilder<int[,], float[,]>
GetEmbeddings()
Gets parameters from the EmbeddingLookup operation.
public float[,] GetEmbeddings()
Returns
- float[,]
Embedding matrix [vocabSize, embeddingDim].
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.