Computes log softmax activations. For each batch `i` and class `j` we have logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i]))) Arguments: logits: 2-D with shape `[batch_size, num_classes]`. Returns Same shape as `logits`.
(scope *Scope, logits tf.Output)
| 42099 | // |
| 42100 | // Returns Same shape as `logits`. |
| 42101 | func LogSoftmax(scope *Scope, logits tf.Output) (logsoftmax tf.Output) { |
| 42102 | if scope.Err() != nil { |
| 42103 | return |
| 42104 | } |
| 42105 | opspec := tf.OpSpec{ |
| 42106 | Type: "LogSoftmax", |
| 42107 | Input: []tf.Input{ |
| 42108 | logits, |
| 42109 | }, |
| 42110 | } |
| 42111 | op := scope.AddOperation(opspec) |
| 42112 | return op.Output(0) |
| 42113 | } |
| 42114 | |
| 42115 | // Returns the next record (key, value pair) produced by a Reader. |
| 42116 | // |