My code is not working even after using the hints section

Hello @Prakhar_Arya,

From this part of the traceback,


it seems to me that you have explicity defined a sigmoid in the graded code cell for my_dense. Initially, the upper part of that code cell should look like the following and it is without def sigmoid:

So, the problem that I would point out first is that you have defined your own sigmoid, which is unexpected. For the sake of assignment submission, we should not add or change any code outside of sections denoted by


### END CODE HERE ### 

So I suggest you to:

  1. revert any change that you have made outside of the sections, including the sigmoid function.
  2. on the jupyter notebook’s menu, click “Kernel” > “Restart”
  3. run your notebook from the first code cell down, and the problem should go away.

Note that making unexpected change might fail some public tests or the autograder’s tests.


PS: The sigmoid function is provided to you in the script file, and it is imported in the first code cell of the assignment via from autils import *. It does not use math.exp because it only supports scalar. Feel free to check out the script file for how its sigmoid is implemented. However, my suggestion is not to fix your own defined sigmoid, but to remove it, because as I have mentioned in the above, unexpected change can cause problem.

1 Like