5
$\begingroup$

In Keras, there are 2 methods to reduce over-fitting. L1,L2 regularization or dropout layer. https://keras.io/regularizers/

https://keras.io/layers/core/#dropout

What are some situations to use L1,L2 regularization instead of dropout layer? What are some situations when dropout layer is better?

$\endgroup$
  • $\begingroup$ L1, L2 regularizers don't really work in NN's if you are using an NN..A good intuition is given by lec 2/3/4 (I am not sure) of Stanford CNN course.. Just serach it on utube $\endgroup$ – DuttaA Aug 23 '18 at 17:36
6
$\begingroup$

I am unsure there will be a formal way to show which is best in which situations - simply trying out different combinations is likely best!

It is worth noting that Dropout actually does a little bit more than just provide a form of regularisation, in that it is really adding robustness to the network, allowing it to try out many many different networks. This is true because the randomly deactivated neurons are essentially removed for that forward/backward pass, thereby giving the same effect as if you had used a totally different network! Have a look at this post for a few more pointers regarding the beauty of dropout layers.

$L_1$ versus $L_2$ is easier to explain, simply by noting that $L_2$ treats outliers a little more thoroughly - returning a larger error for those points. Have a look here for more detailed comparisons.

$\endgroup$
  • $\begingroup$ When I use L2 regularization, the loss rate increase. Do you know why? $\endgroup$ – N.IT Sep 5 '18 at 11:44
  • $\begingroup$ If your $L2$ loss increases, so would your $L1$ loss (just perhaps more slowly). Either way, your model is diverging from a minimum in the loss curve i.e. it isn't learning. You might want to think about other parts of your model again, such as the architecture, data preprocessing or class-imbalance in your data. Those keywords might help you in the right direction with some searches. $\endgroup$ – n1k31t4 Sep 5 '18 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.