# Why Regularization Reduces Overfitting (C2W1L05) | Summary and Q&A

84.1K views
August 25, 2017
by
DeepLearningAI
Why Regularization Reduces Overfitting (C2W1L05)

## TL;DR

Regularization helps prevent overfitting by shrinking the weight matrices and reducing the impact of hidden units, leading to a simpler network that is less prone to overfitting.

## Key Insights

• ⬛ Regularization penalizes large weight matrices, encouraging them to be closer to zero and reducing overfitting.
• 🔽 Increasing the regularization parameter λ results in smaller parameter values, leading to a more linear activation function and a simpler network.
• 🇦🇪 Regularization doesn't eliminate hidden units but rather reduces their impact on the network's output.

## Transcript

why does regularization help with overfitting why does it help with reducing variance problems let's go through a couple examples to gain some intuition about how it works so recall that our high bias high variance and right just right pictures from earlier video I look something like this now let's be a fitting a large and deep neural network I kn... Read More

### Q: How does regularization help with overfitting?

Regularization helps with overfitting by penalizing large weight matrices, encouraging them to be closer to zero. This reduces the complexity of the network and prevents it from fitting noise in the training data.

### Q: What happens when the regularization parameter λ is very large?

When λ is large, the parameters W become very small, leading to smaller values of Z. This results in a more linear activation function and a neural network that behaves more like a linear regression model, reducing the risk of overfitting.

### Q: Does regularization zero out hidden units?

No, regularization doesn't completely zero out hidden units. Instead, it reduces the impact of each hidden unit, resulting in a simpler network with smaller effects from each unit. This makes the network less prone to overfitting.

### Q: How should the cost function be plotted when regularization is used?

When using regularization, the cost function should be plotted with the new definition that includes the additional regularization term. Otherwise, the decrease in the cost function may not be monotonous during gradient descent iterations.

### Q: How does regularization help with overfitting?

Regularization helps with overfitting by penalizing large weight matrices, encouraging them to be closer to zero. This reduces the complexity of the network and prevents it from fitting noise in the training data.

## More Insights

• Regularization penalizes large weight matrices, encouraging them to be closer to zero and reducing overfitting.

• Increasing the regularization parameter λ results in smaller parameter values, leading to a more linear activation function and a simpler network.

• Regularization doesn't eliminate hidden units but rather reduces their impact on the network's output.

• During implementation, it is crucial to plot the cost function with the new definition that includes the regularization term for accurate analysis.

## Summary & Key Takeaways

• Regularization helps reduce overfitting by penalizing the weight matrices from being too large, which encourages setting them closer to zero.

• Shrinking the L2 norm or Frobenius norm of the parameters in a neural network can lead to a simpler network that is less prone to overfitting.

• Using regularization with the 10h activation function can result in smaller parameter values, making the activation function more linear and the network more like a linear regression model.