官术网_书友最值得收藏!

Overcoming over-fitting using regularization

In the previous section, we established that a high weight magnitude is one of the reasons for over-fitting. In this section, we will look into ways to get around the problem of over-fitting, such as penalizing for high weight magnitude values.

Regularization gives a penalty for having a high magnitude of weights in model. L1 and L2 regularizations are among the most commonly used regularization techniques and work as follows:

L2 regularization minimizes the weighted sum of squares of weights at the specified layer of the neural network, in addition to minimizing the loss function (which is the sum of squared loss in the following formula):

Where  is the weightage associated with the regularization term and is a hyperparameter that needs to be tuned, y is the predicted value of , and  is the weight values across all the layers of the model.

L1 regularization minimizes the weighted sum of absolute values of weights at the specified layer of the neural network in addition to minimizing the loss function (which is the sum of the squared loss in the following formula):

.

This way, we ensure that weights do not get customized for extreme cases in the training dataset only (and thus, not generalizing on the test data).

主站蜘蛛池模板: 石景山区| 布拖县| 兴宁市| 环江| 依兰县| 漳平市| 万源市| 樟树市| 罗平县| 凤山县| 乌恰县| 淮阳县| 开平市| 琼中| 镇巴县| 江津市| 安溪县| 娄底市| 泊头市| 浦城县| 米泉市| 山阳县| 开阳县| 鄂伦春自治旗| 布拖县| 元氏县| 宁明县| 平武县| 高清| 岑巩县| 荥阳市| 阳高县| 六安市| 保山市| 峨眉山市| 镇沅| 沁阳市| 稷山县| 嘉义市| 乌鲁木齐市| 长子县|