You are on page 1of 11

SIF 910: Deep Learning

Lecture 6: Modification and Ext. to a Feed Forward Neural Net (1)

Chandra Kusuma Dewa


2021/2022
Outlines

● Overfitting in deep neural network training


● Solving overfitting problem with regularization
● Regularization techniques
○ L1 Regularization
○ L2 Regularization
○ Dropout
What is Overfitting?

Image source: https://arxiv.org/pdf/1901.06566.pdf


Underfit v.s. Normal v.s. Overfit

Image source: http://mlwiki.org/index.php/Overfitting


The main cause of the overfitting problem...

According to Salman and Liu (2019):

● Deep neural networks are prone to


overfitting because of the large
number of parameters to be
learned,
● Continuous gradient updating, and
● Scale sensitiveness of cross
entropy loss

Image source: https://ai.googleblog.com/2019/08/exploring-weight-agnostic-neural.html


How to prevent the problem? - Regularization

We can make the neural


networks less complex by
reducing the value of the
weights for the uninformative
features of the dataset. In other
words, we regularize the model
using the following methods:
● L1 Regularization
● L2 Regularization
● Dropout
● etc

Image source: https://www.analyticsvidhya.com/blog/2018/04/fundamentals-deep-learning-regularization-techniques/


L1 Regularization

Image source: https://androidkt.com/how-to-add-l1-l2-regularization-in-pytorch-loss-function/


L2 Regularization

Image source: https://androidkt.com/how-to-add-l1-l2-regularization-in-pytorch-loss-function/


L1 and L2 Regularization in PyTorch

Image source: https://androidkt.com/how-to-add-l1-l2-regularization-in-pytorch-loss-function/


Dropout

Image source: https://jmlr.org/papers/volume15/srivastava14a/srivastava14a.pdf


Dropout in PyTorch

You might also like