Course 5 W1 Assignment 2 Dinosaurus_Island: sample function value erro

I am running into an issue where my sample function keeps outputting “AssertionError: Wrong values” during testing
This is the code part of the thing I think causing the error:

(Solution code removed, as posting it publicly is against the honour code of this community)

This is the error that I get during the function test:

If you have any idea what is happening or doing wrong, please let me know.
Thank you

Hi @Alzahra_Mustafa_Hass,

The code snippet you posted (which btw is against the honour code to post solution code publicly, hence removed) seems to be correct. I need to take a look at the rest of your code. I’ll DM you regarding it.

Best,
Mubsi

Okay, I apologies for this mistake and thank you for the help.

Hi @Alzahra_Mustafa_Hass,

After a careful look at your code, the snippet you had posted actually had a subtle error, which I didn’t realise when I first looked at it.

To compute z you are using previously computed activation value, when you should have been using the newly computed activation value.

Best,
Mubsi