Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

EmbeddingLayer

EmbeddingLayer[n,size]
represents a trainable net layer that embeds integers between 1 and n into a continuous vector space of dimension size.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Create an embedding layer that will accept 1 or 2 as input and produce an output vector of length 5:

In[1]:=
Click for copyable input
Out[1]=

Create an uninitialized layer with the output size specified:

In[1]:=
Click for copyable input

Initialize the layer with random weights:

In[2]:=
Click for copyable input

Apply the layer to an integer to produce an output vector:

In[3]:=
Click for copyable input
Out[3]=

Create an embedding layer whose input is either True or False:

In[1]:=
Click for copyable input
Out[1]=

Initialize the layer with random weights:

In[2]:=
Click for copyable input

Apply the layer to a list of inputs:

In[3]:=
Click for copyable input
Out[3]=
Introduced in 2016
(11.0)