Couldn't pass the two_layer_model_test

Hello,
I have the following errors. I checked global variables, print out types of all parameters. Nothing worked for me.

Please let me know if anyone could help,

Thanks,
Lisa

Cost after iteration 1: 0.6926114346158594
Cost after first iteration: 0.6930497356599891
Cost after iteration 1: 0.6915746967050505
Error: Datatype mismatch. in variable 0. Got type: <class ‘numpy.float64’> but expected type <class ‘numpy.ndarray’>
Cost after iteration 1: 0.6915746967050505
Cost after iteration 1: 0.6915746967050505
Cost after iteration 2: 0.6524135179683451
3 Tests passed
1 Tests failed

1 Like

It would help if you mention the name of the notebook (there are two assignments this week).

I believe you’re asking about the “Deep Neural Network - Application” assignment.

You can read the test cases by opening the “public_tests.py” file from the File menu.

The error indicates that your code in two_layer_model() is returning the wrong datatype for the “parameters” value.

Thank you for your response. You are right that the notebook was for application.

The mistake must be hidden well and I still could not figure this out yet.

Please let me know what else I could try,

Thanks,
Lisa

There is an error in how your two_layer_model() code is assigning the “parameters” variables.

I did a little more debugging. it seems like the expected cost is array, but mine is float. Am I on the right track?

I am looking into the parameters as well, I printed out all of them. They look fine and passed the data type check.

There must be something I just couldn’t see.

I got it fixed… It is my cost function. Thank you so much for the pointers!

1 Like

Note that we don’t need to copy over any of the functions from the previous “Step by Step” assignment. They are just provided for us.

1 Like