"Boolean" (Net Encoder)
-
See Also
- NetEncoder
- Boole
- NetDecoder
- NetChain
- NetGraph
- True
- False
-
- Net Encoders
- Class
-
- Net Decoders
- Boolean
- Related Guides
- Tech Notes
-
-
See Also
- NetEncoder
- Boole
- NetDecoder
- NetChain
- NetGraph
- True
- False
-
- Net Encoders
- Class
-
- Net Decoders
- Boolean
- Related Guides
- Tech Notes
-
See Also
"Boolean" (Net Encoder)
NetEncoder["Boolean"]
represents an encoder that converts True to 1 and False to 0.
NetEncoder[{"Boolean",{d1,d2,…,dn}}]
represents an encoder that converts tensors of dimensions d1×d2×…×dn of Booleans.
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 equivalent to Boole[input].
- An encoder can be attached to an input port of a net by specifying "port"->NetEncoder[…] when constructing the net.
Examples
open all close allBasic Examples (1)
Scope (2)
Attach a Boolean encoder to the input port of an ElementwiseLayer:
Make a NetChain that processes a 3-length vector of Booleans:
See Also
NetEncoder Boole NetDecoder NetChain NetGraph True False
Net Encoders: Class
Net Decoders: Boolean