0

I have a code which computes the accuracy, but now i want to compute the f1 score.

accuracy_1 = tf.reduce_mean(tf.cast(tf.equal(
    tf.argmax(output_1, axis=-1),
    tf.argmax(y_1, axis=-1)), tf.float32), name="accuracy_1")
accuracy_2 = tf.reduce_mean(tf.cast(tf.equal(
    tf.argmax(output_2, axis=-1),
    tf.argmax(y_2, axis=-1)), tf.float32), name="accuracy_2")

How to compute f1 equivalent for the above code. I'm finding it difficult as i am very new to tensorflow.

William Scott
  • 319
  • 1
  • 5
  • 14

0 Answers0