概述
It can reduce overfitting, but the strength and method need evaluation because excessive constraints can also cause underfitting.
深入探讨
A flexible model can fit training-specific patterns that do not help on unseen data. Regularization changes the fitting process to discourage some of that behavior. One approach adds a penalty based on the model's weights to the prediction loss. An L2 penalty uses a sum of squared weights and encourages shrinkage. An L1 penalty uses absolute values and, in methods such as Lasso, can produce exact zero coefficients. These penalties are mathematical definitions, so their values can be calculated for a given weight vector. For weights minus two and one, the unscaled L1 penalty is three, while the sum-of-squares L2 penalty is five. The total objective may be written as prediction error plus lambda times the penalty. Lambda determines how much influence that penalty has; it does not erase the prediction-error term. Dropout takes a different approach by randomly zeroing activations during training rather than permanently deleting neurons. Early stopping limits training based on a monitored criterion, often validation performance. Data augmentation can also help constrain what patterns a model learns by supplying relevant variations. None of these methods guarantees better performance in every task. Too much regularization can prevent a model from fitting useful structure. Compare training and validation behavior, choose settings with appropriate validation data, and reserve a separate test set for final evaluation when possible. L2 penalties should also not be treated as universally identical to optimizer weight decay: the Decoupled Weight Decay paper explains important differences for adaptive optimizers.
现实世界的实施
Evaluating an L2 penalty when training an image classifier.
Using L1-penalized regression to select a sparse set of candidate features.
Applying dropout to randomly zero activations during neural-network training.
Selecting a stopping point using held-out validation performance.
正则化的未来
Regularization research includes explicit penalties, augmentation, and the influence of optimization on which fitted solution is selected. Improvements should be assessed on relevant held-out data rather than assumed from the name of a technique. Method choice can vary by architecture and task, and a stronger constraint may help one setting while harming another. Clear reporting of the penalty, its strength, the stopping criterion, and the evaluation split makes results easier to interpret and compare.
付诸实践
为什么这很重要
- 更清晰的判决. 它可以帮助您将清晰的技术声明与营销语言分开。
- 成本与预算. 在花费金钱或时间之前,您可以提出更好的实施问题。
- 团队与工作流程. 具有共同理解的团队可以做出更好的产品、政策和学习决策。
留意
- 不同的团队可能会以不同的方式使用同一术语,因此请尽早定义范围。
- 基准测试可能看起来很强大,但实际性能却参差不齐。
- 忽视数据质量和评估计划通常会产生脆弱的结果。
后续步骤
- 从您需要的结果的简单语言定义开始。
- 在测试之前选择一种成功指标和一种失败条件。
- 使用代表性数据运行小型试点,而不是完善的演示集。
- 记录正则化在哪些方面有帮助以及在哪些方面更简单的方法更好。
不断探索
常见问题
什么是正则化?
Regularization includes techniques that constrain fitting in an effort to improve performance on unseen data. It can reduce overfitting, but the strength and method need evaluation because excessive constraints can also cause underfitting.
Why would a practitioner add regularization when a model fits training-specific noise?
Regularization aims to improve generalization, with an effect that needs validation rather than a guarantee.
哪种正则化技术最有可能将某些权重精确为零,从而有效地选择特征?
L1 惩罚权重的绝对值,这往往会将不太有用的权重推至恰好为零,从而执行自动特征选择。 L2 平滑地缩小权重,但很少精确到零。
Dropout 如何在训练过程中规范神经网络?
Dropout 在每个训练步骤中随机将一小部分激活归零,防止神经元过度依赖彼此并近似子网络的集合。
在正则化损失“误差+ lambda × 惩罚”中,增加 lambda 有什么作用?
Lambda 控制正则化强度。更大的 lambda 会给惩罚带来更大的影响,更积极地将权重缩小到更简单的模型。
为什么早期停止可以被视为正则化的一种形式?
当验证性能停止改善时停止,可以防止模型继续进入记忆噪声的状态,就像其他正则化器限制复杂性一样。