T
- data type for loss()
output@Operator(group="nn") public final class SparseSoftmaxCrossEntropyWithLogits<T extends Number> extends PrimitiveOp
Unlike `SoftmaxCrossEntropyWithLogits`, this operation does not accept a matrix of label probabilities, but rather a single label per row of features. This label is considered to have probability 1.0 for the given row.
Inputs are the logits, not probabilities.
operation
Modifier and Type | Method and Description |
---|---|
Output<T> |
backprop()
backpropagated gradients (batch_size x num_classes matrix).
|
static <T extends Number,U extends Number> |
create(Scope scope,
Operand<T> features,
Operand<U> labels)
Factory method to create a class wrapping a new SparseSoftmaxCrossEntropyWithLogits operation.
|
Output<T> |
loss()
Per example loss (batch_size vector).
|
equals, hashCode, op, toString
public static <T extends Number,U extends Number> SparseSoftmaxCrossEntropyWithLogits<T> create(Scope scope, Operand<T> features, Operand<U> labels)
scope
- current scopefeatures
- batch_size x num_classes matrixlabels
- batch_size vector with values in [0, num_classes).
This is the label for the given minibatch entry.Copyright © 2022. All rights reserved.