Class LogSoftmax<T extends TNumber>

java.lang.Object
org.tensorflow.op.RawOp
org.tensorflow.op.nn.LogSoftmax<T>
All Implemented Interfaces:
Shaped, Op, Operand<T>

@Operator(group="nn") public final class LogSoftmax<T extends TNumber> extends RawOp implements Operand<T>
Computes log softmax activations. For each batch i and class j we have
logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i])))
  • Field Details

  • Constructor Details

    • LogSoftmax

      public LogSoftmax(Operation operation)
  • Method Details

    • create

      @Endpoint(describeByClass=true) public static <T extends TNumber> LogSoftmax<T> create(Scope scope, Operand<T> logits)
      Factory method to create a class wrapping a new LogSoftmax operation.
      Type Parameters:
      T - data type for LogSoftmax output and operands
      Parameters:
      scope - current scope
      logits - 2-D with shape [batch_size, num_classes].
      Returns:
      a new instance of LogSoftmax
    • logsoftmax

      public Output<T> logsoftmax()
      Gets logsoftmax. Same shape as logits.
      Returns:
      logsoftmax.
    • asOutput

      public Output<T> asOutput()
      Description copied from interface: Operand
      Returns the symbolic handle of the tensor.

      Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.

      Specified by:
      asOutput in interface Operand<T extends TNumber>
      See Also: