"Scalar" (Net Encoder)

NetEncoder["Scalar"]

represents an encoder that converts a scalar into a length-1 vector.

Details

  • NetEncoder[][input] applies the encoder to an input to produce an output.
  • NetEncoder[][{input1,input2,}] applies the encoder to a list of inputs to produce a list of outputs.
  • The input to the encoder inputi must be a scalar value s. The output of the encoder is then the list {s}.
  • An encoder can be attached to an input port of a net by specifying "port"->NetEncoder[] when constructing the net.

Examples

Basic Examples  (2)

Create a scalar encoder:

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

Create a scalar encoder:

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

Encode a numeric value as a vector of length 1:

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

Encode a list of values at once:

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

See Also

NetEncoder  NetDecoder  NetChain  NetGraph  FeatureExtract

Tutorials

Related NetDecoders