C2W3 How does Dropout layer work?


this week introduced concept of droupout as way to solve overfitting problem. In practical example C2_W3_Lab_1_transfer_learning.ipynb network builds on top of mixed_7 for InceptionV3.

Network code is:

This is original code.

Accuracy curves looks:

So, this looks like expected.

But if I comment out dropout layer:

My expectation was that verification accuracy should go down, but I see this picture:

What’s wrong? What reason of dropout layer here?

1 Like

Hi @Anatoliy_Elsukov
It seems your model is overfitting. So, when you add dropout 20% rate, it introduces a regularization effect by randomly dropping out neurons during training. This encourages the network to learn more robust and generalizable representations. The dropout can lead to fluctuations in the accuracy values as the model learns different patterns or focuses on different features in different training iterations.

hi @carlosrl
thank you for your respond, but it is hard to call model overfitted: validation accuracy higher then training accuracy. anyway pictures are very close and I don’t see any benefits of dropout in this model.

A difference of 2% is not generally considered significant.

@Anatoliy_Elsukov , you are right. Checking the second figure we can see that the two graphs are very close at the end.

Hello @Anatoliy_Elsukov! You are right that using dropout doesn’t benefit much in this case. But try using dropout with 0.5, instead of 0.2, and then comment out the dropout layer and compare the results. Maybe you see a significant difference.

PS: Do this experiment after submission of your assignment.