Week 2 Exercise 5 propagate function 2023 October


I have my code like this

{moderator edit: code removed}

And got this output

Im struggling why it gives me an assert error cause i think my functions are correct.

Can you help me?


Actually the given error is an assertion error. So In the previous exercise we have to assert the variables W,b to avoid this error. I would like to ask whether the previous exercise has the following output as per the given image…

{moderator edit: code removed}


Hi @Saket_Choudary01 !

The assertions are encapsulated in the function “propagate_test(propagate)”.

I cant see the assertions that are in the function.


Go back to exercise 4 and check there. If you miss sumthin ping me up

Note: Please do not post your code on the forum. That’s not allowed by the Code of Conduct. You can post any error messages or asserts.

If a mentor needs to see your code, we’ll contact you with instructions:
= = = = =
The issue is here:

For that specific test, your code is returning a 4-element vector for dw, when the expected result is a scalar ( a 1-element vector).

Notice that your code doesn’t give the expected results here either:

How confident are you that your sigmoid function is correct?

1 Like

@Saket_Choudary01, please do not post your code on the forum.

That is not allowed by the Code of Conduct.

Yes Sir I think i suspect the error is in sigmoid function. However that was a hunch from my side.

1 Like

Yes sir thanks for the heads up!! I’ll follow it from now on

1 Like

Sorry @TMosh not gonna do it again.

Im confident of my sigmoid function because of the correct tests


If i can get in touch with an instructor, that would be great!

So pls connect with me at Linkedin

Or ping me up in instagram ID:soapmactavish0095

@Saket_Choudary01, please read the Code of Conduct:

Please do not imply that another student should send you their code. There is no reason for a private conversation, as the community will benefit if the question can be debugged here in public.

This is just a friendly caution, as perhaps you are not aware of the rules.

@TMosh Yes sir Thanks for the heads up! I’ll be following from now on

Regarding this test result:


I’m not convinced that is a very robust test.

Summary of the issue:
Be sure you do not modify any code in the propagate() function outside of the “YOUR CODE STARTS HERE” area.

For example, modifying the code for “m = …” will make your code compute the wrong dw and db values.

For others who find this thread, be aware of some formatting issues in the assert output.
The fuchsia color outlines the three dw values returned by the propagate_test() function, the lime green outlines the expected values.