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

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).

主站蜘蛛池模板: 泗洪县| 古丈县| 扶余县| 湘潭县| 基隆市| 阿拉善左旗| 沁源县| 任丘市| 铜山县| 明光市| 克东县| 五指山市| 化德县| 讷河市| 城口县| 金华市| 乌什县| 富顺县| 镇雄县| 南澳县| 玛多县| 博爱县| 电白县| 石渠县| 芜湖县| 泰安市| 商丘市| 金溪县| 措勤县| 肇源县| 沂南县| 怀仁县| 文化| 东方市| 巧家县| 德保县| 合山市| 保靖县| 启东市| 河间市| 慈利县|