• 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();

    Parameters

    • yTrue: Tensor<Rank>

      Binary Tensor of truth: one-hot encoding of categories.

    • yPred: Tensor<Rank>

      Binary Tensor of prediction: probabilities or logits for the same categories as in yTrue.

    Returns Tensor

    Accuracy Tensor.

    Doc

Generated using TypeDoc