Something I don't understand in the Unit_Test of Exercise 2


I was playing with the code to see how the Unit_Test checked my answer, and I found two things that I didn’t understand.

  1. How the outputs(a_out) of the three tests are not numbers between 0 and 1 while I am using sigmoid as an activation function?
  2. The second and third test have the same input(a_in) and same weights(W, b), but have different outputs(a_out)

Note that I passed all the tests

That’s my code
{assignment code removed by mentor}
Thanks in advance! :smile:

Since your my_dense function actually gets passed the activation function, g, as a parameter, there is no guarantee that g is the sigmoid function. In this case, it appears that the test_c2 script that is generating those printed statements is using linear activation functions. For #1 and #2, it appears that a simple linear activation function of g(z) = z is being passed, and for #3, an activation function of g(z) = 3z is used.

1 Like

@Islam_Omar, please do not post your code on the forum. That’s not allowed by the community standards.