"Boolean" (Net Encoder)

NetEncoder["Boolean"]

represents an encoder that converts True to 1 and False to 0.

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 either True or False.
  • The output of the encoder is 0 if input is False, and 1 if input is True. This is equivalent to Boole[inputi].
  • An encoder can be attached to an input port of a net by specifying "port"->NetEncoder[] when constructing the net.

Examples

open allclose all

Basic Examples  (1)

Create a Boolean encoder:

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

Use it to encode an input:

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

The encoder maps over a batch of examples:

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

Scope  (1)

See Also

NetEncoder  Boole  NetDecoder  NetChain  NetGraph  True  False

Tutorials

Related NetEncoders

Related NetDecoders