pythontensorflowkerasmetricsepsilon

Keras, Tensorflow - What is the meaning of K.epsilon when computing metrics


I am computing Recall and Accuracy for my model and I am wondering why people add Keras.epsilon() to their variables (examples found on stackoverflow : Macro metrics (recall/F1...) for multiclass CNN or How to calculate F1 Macro in Keras? )

Thank you very much for your answer !

Kindly


Solution

  • When there's a division operation taking place, it's often added to the denominator to prevent a divide by zero error. Epsilon is small value (1e-07 in TensorFlow Core v2.2.0) that makes very little difference to the value of the denominator, but ensures that it isn't equal to exactly zero.