Overfitting example not working as intended. Programming Assignment: Planar Data Classification with One Hidden Layer

Classroom item: Planar Data Classification with One Hidden Layer

Exercise: 6 - Tuning hidden layer size (optional/ungraded exercise)

As you can see from the screenshot, the overfitting demonstration isn’t working. All of the networks achieved the same result. I don’t think it’s a problem with my code either, since I didn’t edit the code in exercise 6 and all my code until then has passed all the assertions.

I even tried changing the number of hidden layers to 50. There was no change

Though I did get a score of 88/100, so I suppose I might have messed something up.

Overfiting means the model will fit to the training data perfectly well, especially as you increase the number of hidden layers. But not fit well the data if the number of layers is small!

Sorry, but I think that is the operative theory here. Here is what I see in that section:

Time for a little more code inspection! :nerd_face:

You didn’t modify the code in section 6, but it’s calling your functions, right? One thing to look for is hard-coding things. E.g. how did you handle n_h in nn_model? I’ll bet it’s always 4, regardless of what is passed. That would pass the test cases in the notebook, but fail the grader. And would give precisely the results that you show. :laughing:

2 Likes