[snippet removed by mentor]
- can anyone tell me what’s wrong here.
- what is meaning of “sigmoid_derivative_test(sigmoid_derivative)”.
3.why we are typecasting to string here "print (“sigmoid_derivative(t_x) = " + str(sigmoid_derivative(t_x)))”/
[snippet removed by mentor]
sigmoid_derivative_tests
takes a reference to the sigmoid_derivative
function which it an internally invoke to check for correctness of implementation of the function. If you have background in C, think of it as a function pointer. Do keep in mind that this specialization assumes working knowledge of python. Moving forward without an understanding of the basics is not a good idea. That said, there are plenty of online and coursera tutorials that cover enough python required for this specialization.str
:>>> "hello" + 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can only concatenate str (not "int") to str
>>> "hello" + str(1)
'hello1'
Note that the “ndarray is not callable” error message is caused by this expression in your code:
s(1 - s)
This is one of the many cases in which math notation is different than programming languages. What that means in python is that s is a function and you are calling it with the argument (1 - s). If what you intended was to multiply those two quantities, the syntax for that in python is:
s * (1 - s)
As Balaji says, reasonable knowledge and experience with python is a prerequisite here.
Yeah, but easy to make the silly mistake of coding s(1 - 2) in my opinion even if you’re a little rusty on Python but not completely ignorant. Thanks so much for clarifying this. Balaji’s reply was detailed without being of much help.