Computes the softmax normalized vector given the logits.
const a = tf.tensor1d([1, 2, 3]);a.softmax().print(); // or tf.softmax(a) Copy
const a = tf.tensor1d([1, 2, 3]);a.softmax().print(); // or tf.softmax(a)
const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);a.softmax().print(); // or tf.softmax(a) Copy
const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);a.softmax().print(); // or tf.softmax(a)
The logits array.
Optional
The dimension softmax would be performed on. Defaults to -1 which indicates the last dimension.
-1
Computes the softmax normalized vector given the logits.