Package smile.deep.layer
Class EmbeddingLayer
java.lang.Object
smile.deep.layer.EmbeddingLayer
An embedding layer that is a simple lookup table that stores embeddings
of a fixed dictionary and size.
This layer is often used to store word embeddings and retrieve them using indices. The input to the module is a list of indices, and the output is the corresponding word embeddings.
-
Constructor Summary
ConstructorDescriptionEmbeddingLayer
(int numTokens, int dim) Constructor.EmbeddingLayer
(int numTokens, int dim, double alpha) Constructor. -
Method Summary
-
Constructor Details
-
EmbeddingLayer
public EmbeddingLayer(int numTokens, int dim) Constructor.- Parameters:
numTokens
- the size of the dictionary of embeddings.dim
- the size of each embedding vector.
-
EmbeddingLayer
public EmbeddingLayer(int numTokens, int dim, double alpha) Constructor.- Parameters:
numTokens
- the size of the dictionary of embeddings.dim
- the size of each embedding vector.alpha
- optional scaling factor.
-
-
Method Details