Regularization If you suspect your neural network is overfitting your data i.e. you have high variance problem, one of the first thing you should try is regularization. The other way to address high variance is to get more training data that's also quite relatable. But you can't always get more training data or it could be expensive to get more training data. But adding regularization will often helps to prevent overfitting or to reduce the errors in your network. How regularization works? Let's say I'm using logistic regression, so my cost function is defined as: `J(w,b)= \frac{1}{m}\sum_{i=1}^{m}L(\hat{y}^{(i)},y^{(i)})` To add regularization to the logistic regression, you add \Lambda which is called the regularization paramter. `J(w,b)= \frac{1}{m}\sum_{i=1}^{m}L(\hat{y}^{(i)},y^{(i)})+\frac{\lambda}{2m}\sum ||w||_{2}^{2}` `||w||_{2}^{2}=\sum_{j=1}^{n_{x}}w_{j}^{2}=w^{T}w` Now why do we regularize just the parameter w? why don't you add something here abou...
Regularization If you suspect your neural network is overfitting your data i.e. you have high variance problem, one of the first thing you should try is regularization. The other way to address high variance is to get more training data that's also quite relatable. But you can't always get more training data or it could be expensive to get more training data. But adding regularization will often helps to prevent overfitting or to reduce the errors in your network. How regularization works? Let's say I'm using logistic regression, so my cost function is defined as: `J(w,b)= \frac{1}{m}\sum_{i=1}^{m}L(\hat{y}^{(i)},y^{(i)})` To add regularization to the logistic regression, you add \Lambda which is called the regularization paramter. `J(w,b)= \frac{1}{m}\sum_{i=1}^{m}L(\hat{y}^{(i)},y^{(i)})+\frac{\lambda}{2m}\sum ||w||_{2}^{2}` `||w||_{2}^{2}=\sum_{j=1}^{n_{x}}w_{j}^{2}=w^{T}w` Now why do we regularize just the parameter w? why don't you add something here abou...