Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

k_ctc_decode

Decodes the output of a softmax.


Description

Can use either greedy search (also known as best path) or a constrained dictionary search.

Usage

k_ctc_decode(
  y_pred,
  input_length,
  greedy = TRUE,
  beam_width = 100L,
  top_paths = 1
)

Arguments

y_pred

tensor (samples, time_steps, num_categories) containing the prediction, or output of the softmax.

input_length

tensor (samples, ) containing the sequence length for each batch item in y_pred.

greedy

perform much faster best-path search if TRUE. This does not use a dictionary.

beam_width

if greedy is FALSE: a beam search decoder will be used with a beam of this width.

top_paths

if greedy is FALSE, how many of the most probable paths will be returned.

Value

If greedy is TRUE, returns a list of one element that contains the decoded sequence. If FALSE, returns the top_paths most probable decoded sequences. Important: blank labels are returned as -1. Tensor (top_paths) that contains the log probability of each decoded sequence.

Keras Backend

This function is part of a set of Keras backend functions that enable lower level access to the core operations of the backend tensor engine (e.g. TensorFlow, CNTK, Theano, etc.).

You can see a list of all available backend functions here: https://keras.rstudio.com/articles/backend.html#backend-functions.


keras

R Interface to 'Keras'

v2.4.0
MIT + file LICENSE
Authors
Daniel Falbel [ctb, cph, cre], JJ Allaire [aut, cph], François Chollet [aut, cph], RStudio [ctb, cph, fnd], Google [ctb, cph, fnd], Yuan Tang [ctb, cph] (<https://orcid.org/0000-0001-5243-233X>), Wouter Van Der Bijl [ctb, cph], Martin Studer [ctb, cph], Sigrid Keydana [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.