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)
BUILT-IN WOLFRAM LANGUAGE SYMBOL

NetDecoder

NetDecoder[form]
represents a decoder that takes a net representation and decodes it into an expression of a given form.

DetailsDetails

  • A NetDecoder object can be attached to an output port of a net by specifying "port"->NetDecoder[] when constructing the net. Specifying "port"->"type" will create a decoder of the given type and attach it.
  • Possible forms include:
  • "Scalar"a single numeric value
    "Image"an RGB image
    {"Image",ColorSpaces}image with specified color space
    {"Class",{c1,c2,}}the ci for which the probability is highest
  • NetDecoder[][array] gives the specified decoded form for array.
  • NetDecoder[][{array1,array2, }] explicitly computes outputs for each of the arrayi.
  • With NetDecoder[{"Class", {c1,c2,}}], the ci typically represent categorical classes in a classifier.
  • NetDecoder[{"Class",}][array,prop] allows the following properties:
  • "Decision"the class ci with the highest probability
    {"TopDecisions",n}the n classes with the highest probabilities
    "TopProbabilities"probabilities for the most likely ci, returned as a list of rules
    {"TopProbabilities",n}probabilities for the n most likely ci
    "Probabilities"the association <|c1->p1,c2->p2,|>
    {"Probability",ci}probability for a specific ci
    "Entropy"the entropy of the probability distribution
  • NetDecoder is not involved in training done by NetTrain.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Create a scalar decoder:

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

Use it to decode a vector of length one to a single scalar value:

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

Decode a set of vectors at once:

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

Create an image decoder:

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

Use it to decode an array into an image:

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

Create a class decoder:

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

Use it on a probability vector to make a class prediction:

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

Return the top two predictions:

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

Return the probabilities for all classes:

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

Specify an image decoder on a pooling layer:

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

Evaluating the layer will decode the output as an image:

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