Week 3 assignment: accuracy does not change (50%)

Hi everyone,

In section 5.2 of my assignment, the model accuracy is only 50%.
The plot shows the points (red/blue) with an orange background.
It seems the entire dataset is being assigned only one class.

All tests were passed until this point and section 5.2 doesn’t even ask for any code…

I submitted it anyway, just to see the outcome, and got 88% (pass). However, I would like to know what I did wrong.

Thank you!
Rafael

Hi @rafael.rodrigues
Some hints here:

  1. Please check whether your coast function decreases as expected.
  2. Check not only if “Test passed” but also if the output values match the expected output.
    Keep learning!

Hi Carlos,

Thank you for the suggestions!

The first cost function computation gives a reasonable value, but the second printed value is 84.7…, which remains constant throughout the training.

As for the outputs, everything matches the expected values up until this point (cost and prediction accuracy).

In the plot, considering a 50% accuracy, I was expecting the background to be one of the class colors (red or blue), but it is neither…

Rafael

@rafael.rodrigues , just to have an idea, in the # GRADED FUNCTION: nn_model, the output values must match exactly the same as the expected output. Otherwise, the code is facing issues in, at least, one of the implemented functions. In this case, the suggestion is going to start the notebook and compare each output with expected and I think you will find where is the issue.
Note the cost function value starts in 0.652… and tends to decrease to zero.
Keep learning!

I was able to find the bug, thank you!
The accuracy is now 90% as expected.

However, I resubmitted the assignment and the grade is still 88/100.

grader output:
[ValidateApp | INFO] Validating ‘/home/jovyan/work/submitted/courseraLearner/W3A1/Planar_data_classification_with_one_hidden_layer.ipynb’ [ValidateApp | INFO] Executing notebook with kernel: python3 Tests failed on 1 cell(s)! These tests could be hidden. Please check your submission.
Any idea of what may be causing this?

Thanks,
Rafael

Please take a look at this thread. Maybe you are facing the same issue

@rafael.rodrigues Can you help me, Even I am getting 58% accuracy, I checked with all the values of cost after iteration they are the same as expected.
And even after running 5.2 . The values of cost after iterations are same as the values of nn_model()