({{, (RefLink[NetDecoder, paclet:ref/NetDecoder])[{"CTCBeamSearch",alphabet}]
represents a decoder that interprets a sequence of probability vectors and gives the most likely sequence decoding.}, {, (RefLink[NetDecoder, paclet:ref/NetDecoder])[{"CTCBeamSearch",…,"BeamSize"->n}]
represents a decoder with specified beam size.}})

OpenersNotesSection(Spacer1)Details

(RefLink[NetDecoder, paclet:ref/NetDecoder])[…][input] applies the decoder to an input to produce an output.

(RefLink[NetDecoder, paclet:ref/NetDecoder])[…][{(Subscript[input, 1]),(Subscript[input, 2]),…}] applies the decoder to a list of inputs to produce a list of outputs.

The input array to the "CTCBeamSearch" decoder must be a sequence of vectors, each of size n+1, where n is the size of the alphabet. The last element of each vector represents the special blank class.

The output of "CTCBeamSearch" is a sequence of elements from the alphabet whose maximum length is equal to the length of the input sequence. Fewer elements are typically returned.

A decoder can be attached to an output port of a net by specifying "port"->(RefLink[NetDecoder, paclet:ref/NetDecoder])[…] when constructing the net.

With the parameter "BeamSize"->n, the "CTCBeamSearch" decoder will maintain a set of n candidate decodings during processing. The default is 100.

A "BeamSize" of 1 is equivalent to greedy search, where top probability is chosen at each element in the sequence.

(RefLink[NetDecoder, paclet:ref/NetDecoder])[…][data,prop] can be used to calculate a specific property for the input data.

When a "CTCBeamSearch" decoder is attached to a net, net[data,prop] or net[data,"oport"->prop] can be used to calculate a specific property of the decoded output.

The "CTCBeamSearch" decoder supports the following properties:

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Create a CTC beam search decoder:

dec=NetDecoder[{"CTCBeamSearch",{"a","b"}}]

Use the decoder on a sequence of probability vectors:

dec[{{0.5,0.2,0.3},{0.4,0.2,0.4},{0.3,0.5,0.2}}]

Obtain the top three decoded sequences and their negative log-likelihoods:

dec[{{0.5,0.2,0.3},{0.4,0.2,0.4},{0.3,0.5,0.2}},{"TopNegativeLogLikelihoods",3}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[NetDecoder, paclet:ref/NetDecoder])  ▪  (RefLink[CTCLossLayer, paclet:ref/CTCLossLayer])  ▪  (RefLink[NetEncoder, paclet:ref/NetEncoder])  ▪  (RefLink[NetChain, paclet:ref/NetChain])  ▪  (RefLink[NetGraph, paclet:ref/NetGraph])}, {Related Net Encoders:  (RefLink[Characters, paclet:ref/netencoder/Characters])  ▪  (RefLink[Class, paclet:ref/netencoder/Class])}, {Related Net Decoders:  (RefLink[Characters, paclet:ref/netdecoder/Characters])  ▪  (RefLink[Class, paclet:ref/netdecoder/Class])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Neural Networks in the Wolfram Language, paclet:tutorial/NeuralNetworksOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Neural Networks, paclet:guide/NeuralNetworks])}})}})