Categorical accuracy metric function.
Example:
const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);const accuracy = tf.metrics.categoricalAccuracy(x, y);accuracy.print(); Copy
const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);const accuracy = tf.metrics.categoricalAccuracy(x, y);accuracy.print();
Binary Tensor of truth: one-hot encoding of categories.
Binary Tensor of prediction: probabilities or logits for the same categories as in yTrue.
yTrue
Accuracy Tensor.
Generated using TypeDoc
Categorical accuracy metric function.
Example: