T
- data type for loss()
output@Operator(group="nn") public final class CtcLoss<T extends Number> 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 and Description |
---|---|
static class |
CtcLoss.Options
Optional attributes for
CtcLoss |
operation
Modifier and Type | Method and Description |
---|---|
static <T extends Number> |
create(Scope scope,
Operand<T> inputs,
Operand<Long> labelsIndices,
Operand<Integer> labelsValues,
Operand<Integer> sequenceLength,
CtcLoss.Options... options)
Factory method to create a class wrapping a new CtcLoss operation.
|
static CtcLoss.Options |
ctcMergeRepeated(Boolean ctcMergeRepeated) |
Output<T> |
gradient()
The gradient of `loss`.
|
static CtcLoss.Options |
ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) |
Output<T> |
loss()
A vector (batch) containing log-probabilities.
|
static CtcLoss.Options |
preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) |
equals, hashCode, op, toString
public static <T extends Number> CtcLoss<T> create(Scope scope, Operand<T> inputs, Operand<Long> labelsIndices, Operand<Integer> labelsValues, Operand<Integer> sequenceLength, CtcLoss.Options... options)
scope
- current 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(Boolean preprocessCollapseRepeated)
preprocessCollapseRepeated
- Scalar, if true then repeated labels are
collapsed prior to the CTC calculation.public static CtcLoss.Options ctcMergeRepeated(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(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.Copyright © 2022. All rights reserved.