Op@Operator(group="nn") public final class CtcLoss extends PrimitiveOp
the gradient. This class performs the softmax operation for you, so inputs should be e.g. linear projections of outputs by an LSTM.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
CtcLoss.Options |
Optional attributes for
CtcLoss |
operation| Modifier and Type | Method | Description |
|---|---|---|
static CtcLoss |
create(Scope scope,
Operand<java.lang.Float> inputs,
Operand<java.lang.Long> labelsIndices,
Operand<java.lang.Integer> labelsValues,
Operand<java.lang.Integer> sequenceLength,
CtcLoss.Options... options) |
Factory method to create a class to wrap a new CtcLoss operation to the graph.
|
static CtcLoss.Options |
ctcMergeRepeated(java.lang.Boolean ctcMergeRepeated) |
|
Output<java.lang.Float> |
gradient() |
The gradient of `loss`.
|
static CtcLoss.Options |
ignoreLongerOutputsThanInputs(java.lang.Boolean ignoreLongerOutputsThanInputs) |
|
Output<java.lang.Float> |
loss() |
A vector (batch) containing log-probabilities.
|
static CtcLoss.Options |
preprocessCollapseRepeated(java.lang.Boolean preprocessCollapseRepeated) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitequals, hashCode, toStringpublic static CtcLoss create(Scope scope, Operand<java.lang.Float> inputs, Operand<java.lang.Long> labelsIndices, Operand<java.lang.Integer> labelsValues, Operand<java.lang.Integer> sequenceLength, CtcLoss.Options... options)
scope - current graph scopeinputs - 3-D, shape: `(max_time x batch_size x num_classes)`, the logits.labelsIndices - The indices of a `SparseTensorlabelsValues - The values (labels) associated with the given batch and time.sequenceLength - A vector containing sequence lengths (batch).options - carries optional attributes valuespublic static CtcLoss.Options preprocessCollapseRepeated(java.lang.Boolean preprocessCollapseRepeated)
preprocessCollapseRepeated - Scalar, if true then repeated labels are
collapsed prior to the CTC calculation.public static CtcLoss.Options ctcMergeRepeated(java.lang.Boolean ctcMergeRepeated)
ctcMergeRepeated - Scalar. If set to false, during CTC calculation
repeated non-blank labels will not be merged and are interpreted as
individual labels. This is a simplified version of CTC.public static CtcLoss.Options ignoreLongerOutputsThanInputs(java.lang.Boolean ignoreLongerOutputsThanInputs)
ignoreLongerOutputsThanInputs - Scalar. If set to true, during CTC
calculation, items that have longer output sequences than input sequences
are skipped: they don't contribute to the loss term and have zero-gradient.public Output<java.lang.Float> loss()
public Output<java.lang.Float> gradient()