• Sparse categorical accuracy metric function.

    Example:


    const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);
    const yPred = tf.tensor2d(
    [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);
    const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);
    crossentropy.print();

    Parameters

    • yTrue: Tensor<Rank>

      True labels: indices.

    • yPred: Tensor<Rank>

      Predicted probabilities or logits.

    Returns Tensor

    Accuracy tensor.

    Doc

Generated using TypeDoc