Keras Embedding Layer

An embedding network layer. This layer receives a sequence of non-negative integer indices and learns to embed those into a high dimensional vector (the size of which is specified by output dimension). This layer can only be used as the first layer in a model (after the input layer). Corresponds to the Embedding Keras layer. Note that the Keras documentation is outdated. The input to this layer can be of arbitrary rank and the output of this layer will have to be a tensor with one additional dimension. The inputs to this layer i.e. the values fed in the learner or executor must be integers in the interval [0, n) where n is the specified input dimension.

Options

Name prefix
The name prefix of the layer. The prefix is complemented by an index suffix to obtain a unique layer name. If this option is unchecked, the name prefix is derived from the layer type.
Input dimension
Size of vocabulary, i.e. maximum integer index + 1. The inputs to this layer during execution or learning must be integers in the interval [0, n) where n is the specified input dimension.
Output dimension
Dimension of the dense embedding.
Initializer
The initializer for the embedding matrix.
Embedding regularizer
An optional regularizer for the embedding matrix.
Constraint
An optional constraint for the embedding matrix.
Mask zero
Whether or not the input value 0 is a special "padding" value that should be masked out This is useful when using recurrent layers which may take variable length input. If this is selected then all subsequent layers in the model need to support masking or an exception will be raised during execution. If mask_zero is set to True, as a consequence, index 0 cannot be used in the vocabulary (input dimension should equal size of vocabulary + 1).

Input Ports

Icon
The Keras deep learning network to which to add an Embedding layer.

Output Ports

Icon
The Keras deep learning network with an added Embedding layer.

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.