C2_W1 Assignment, excersise 2

I don’t understand the problem in my solution for the 2-nd excersise. Please, could anyone explain me, where is my mistake?

Hello @AlenaKn,

Welcome to our community!

I think you are asking about Exercise 3, right? Because from your screenshot, it is testing the my_dense_v function. Exercise 2 is for the my_dense function, whereas the exercise 3 is for the my_dense_v function.

That is not totally your problem. I am afraid that the test has used a different A_in shape so that if you use the for-loop approach by treating it as a (m, n) array, it will have the IndexError problem.

However, exercise 3 is by designed requiring us to do it vectorized-wise (because we have implemented the for-loop approach in exercise 2). If we had done it vectorized-wise as hinted, that error wouldn’t have shown up.

I will discuss this with the team but any changes will take time. For now, I would suggest you to follow the approach in the Hints (underneath the exercise’s code cell) and do it vectorized-wise like that.


PS: Note the following message about exercise 3

This function is not graded because it is discussed in the optional lectures on vectorization. If you didn’t go through them, feel free to click the hints below the expected code to see the code. You can also submit the notebook even with a blank answer here.

If you want to submit the assignment first before digging into vectorization, it is possible for us to just leave the exercise 3 blank.

Oh, yes, indeed. I’ve confused with exercises and missed that that one should be done using vertirized form.
Thank you for the clarification!

You are welcome, @AlenaKn!