Error in Exercise 2 week 3 course 2

Hello Team,
Could you please help in this exercise , I am getting following error while calculating sigmoid

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

1 Like

@TEJAS_JUWEKAR Are you sure you are using the right datatype?

Note: Despite what the error says you do not need to use .any() / .all() to solve this problem.

3 Likes

That error does not make any sense in the context of the sigmoid function. There should be no conditional logic (no “if” or “switch” statements) in sigmoid, right? There are no choices or decisions to be made: all you need to do is invoke the TF sigmoid function with the appropriate argument.

3 Likes

Dear @TEJAS_JUWEKAR,

Can you please share your screenshot of the error.