C1_W3_Assignment - Exercise 5 (Single Perceptron Neural Networks for Linear Regression)

I don’t understand what I’m doing wrong here

{moderator edit: image containing code was removed}


I’m getting the correct output yet I’m still getting that error
I don’t think I’ve used any of the function in an incorrect way

First suggestion, do not use the @ operator. The assert shows you used it in your forward_propagation() function.

Use the appropriate numpy function instead.

Also, please don’t post your code on the forum. That is not allowed by the Code of Conduct.
If a mentor needs to see your code, we’ll contact you with instructions.

You can post any error messages or asserts, that’s usually enough to identify an issue.

I suspect you may have modified something else in the notebook which is causing this error.

oh okay, I was unaware about the code of conduct, I will be mindful from next time

My intialise_parameters function had an issue too, which I couldn’t figure out, it only passed 5 out of 6 tests, but I thought of it as a minor problem to be dealt with in the end since the programme wasn’t screaming at me

is this the issue? (and I’m not sure what’s causing it)

Failing any test is a bad thing. Especially since this function is used later in the notebook, and could cause exactly the sort of “size mismatch” error that the @ operator is throwing.

well I changed the @ to np.dot() in the forward_propagation() function but I still don’t know what’s causing the problem in intialise_parameters()

I managed to fix it, I’d accidentally tampered with the code outside “start here”, “end here” lines

Thanks for your report.