Hey @DURGESH_RAO,
It means that you have incorrectly implemented the nn_model function. Since this function is basically calling the other functions which you have implemented in this assignment till now, it is highly likely that one of those functions has an incorrect implementation. Please ensure that you have passed all the test cases for the previous functions, and even if you have, make sure you haven’t hard-coded any variables. If you are still unable to find the issue, feel free to DM your notebook as an attachment to me. You can find the instructions to download your notebook here.
Hey @DURGESH_RAO,
I just went over your entire kernel, and couldn’t find any issue. I copied the code for all the first 8 exercises from your kernel and they ran perfectly fine in my Coursera Labs. It looks like you have involuntarily changed something apart from the code that you were supposed to. Can you please try to get a new version of the assignment and run that? You can find the instructions for doing so in this thread. Let me know if this helps.
P.S. - Posting code publicly is against the community guidelines. If a mentor needs to take a look at your code, he/she will ask you to DM it, as I did. So, please make sure that if any solution code is involved, you only DM it to a mentor and not post it publicly.
Hey @DURGESH_RAO, @anon57530071 just took a look at your code and found that in the initialize_parameters function, you have set the random seed as 2, np.random.seed(2), whereas in the original assignment, random seed hasn’t being set when this function is defined. So, when your function is called np.random.randn gives results according to 2 being the random seed, whereas in the original assignment, np.random.randn gives results according to 3 being the random seed.
In simple words, remove np.random.seed(2) from your definition of initialize_parameters function and then try to run the assignment. If you still face an issue, then get a new copy of the assignment, and use that for submission. Let me know if this helps.
Notice that your cost values after 1000 and 2000 iterations are quite a bit higher than the expected values. That would suggest there is something wrong with your “update parameters” logic. But if you are sure that all your previous functions passed their tests, then the bug (whatever it is) must be in nn_model. E.g. you are passing the wrong arguments to one of the previous functions when you call it from nn_model.
This seems to be a duplicate post as this.
Actually, your case is totally different from this case. Did you read the last update by Elemento ?
It was a problem of a seed for a random number generator. You can check your code, initialize_parameters, but, I believe it’s not your case.