Table of Contents

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
Layer<int[,], float[,]>
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

vocabSize int

Size of the vocabulary (number of unique tokens).

embeddingDim int

Dimensionality of the embedding vectors.

paramInitializer ParamInitializer

Initializer 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.