Embedding
A simple lookup table that stores embeddings of a fixed dictionary and size.
This module 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.
Value parameters
- embeddingDim
-
The size of each embedding vector
- maxNorm
-
If given, each embedding vector with norm larger than
maxNorm
is renormalized to have normmaxNorm
. - normType
-
The p of the p-norm to compute for the
maxNorm
option. Default2
. - numEmbeddings
-
Size of the dictionary of embeddings
- paddingIdx
-
If specified, the entries at
paddingIdx
do not contribute to the gradient; therefore, the embedding vector atpaddingIdx
is not updated during training, i.e. it remains as a fixed "pad". For a newly constructed Embedding, the embedding vector atpaddingIdx
will default to all zeros, but can be updated to another value to be used as the padding vector. - scaleGradByFreq
-
If given, this will scale gradients by the inverse of frequency of the words in the mini-batch. Default
false
. - sparse
-
If
True
, gradient w.r.t.weight
matrix will be a sparse tensor. See Notes for more details regarding sparse gradients.
Attributes
- See also
- Source
- Embedding.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Attributes
- Definition Classes
- Source
- Embedding.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
- Source
- Embedding.scala
Attributes
- Source
- Embedding.scala
Attributes
- Source
- Embedding.scala
Inherited methods
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- HasParams
- Source
- Module.scala
Attributes
- Definition Classes
- Inherited from:
- HasParams
- Source
- Module.scala
Attributes
- Definition Classes
- Inherited from:
- HasParams
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Adds a buffer to the module.
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Concrete fields
Attributes
- Source
- Embedding.scala