[C2W3_Lab_01_Model_Evaluation_and_Selection] tf.math.sigmoid

  • Week 3 of Course 2 Advanced Learning Algorithms
  • C2W3_Lab_01_Model_Evaluation_and_Selection

What is the difference between tf.math.sigmoid, tf.nn.sigmoid, and tf.sigmoid?

From looking over the TensorFlow documentation, I think they are all the same - the core function appears to be tf.math.sigmoid(). Searching for the other two functions tends to link back there.

The lab only uses tf.math.sigmoid().

Thank you @TMosh

I tried the three functions but they output different values
In the screenshot, I printed out the yhat1-yhat. yhat1 used tf.nn.sigmoid and yhat used tf.math.sigmoid

That’s curious. I do not know what’s happening there.

Hi @Weiwei_Wang

image

The first sigmoid modified yhat before it is passed into the second sigmoid.

Cheers,
Raymond

@rmwkwok, good point.

Oh that was a silly mistake. Thank you very much @rmwkwok