• Loss or metric function: Mean absolute error.

    Mathematically, mean absolute error is defined as: mean(abs(yPred - yTrue)), wherein the mean is applied over feature dimensions.

    const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);
    const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);
    const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);
    mse.print();

    Parameters

    • yTrue: Tensor<Rank>

      Truth Tensor.

    • yPred: Tensor<Rank>

      Prediction Tensor.

    Returns Tensor

    Mean absolute error Tensor.

    Doc

Generated using TypeDoc