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

Understanding the scenario of overfitting

In some of the previous recipes, we have noticed that the training accuracy is ~100%, while test accuracy is ~98%, which is a case of overfitting on top of a training dataset. Let's gain an intuition of the delta between the training and the test accuracies.

To understand the phenomenon resulting in overfitting, let's contrast two scenarios where we compare the training and test accuracies along with a histogram of the weights:

  • Model is run for five epochs
  • Model is run for 100 epochs

The comparison-of-accuracy metric between training and test datasets between the two scenarios is as follows:

Once we plot the histogram of weights that are connecting the hidden layer to the output layer, we will notice that the 100-epochs scenario has a higher spread of weights when compared to the five-epochs scenario:

From the preceding pictures, you should note that the 100 epochs scenario had a higher dispersion of weight values when compared to the five-epochs scenario. This is because of the higher amount of opportunity that the model had to overfit on top of the training dataset when the model is run for 100-epochs, when compared to when the model is run for five epochs, as the number of weight updates in the 100-epochs scenario is higher than the number of weight updates in the five-epochs scenario.

A high value of weight (along with a difference in the training and test dataset) is a good indication of a potential over-fitting of the model and/or a potential opportunity to scale input/weights to increase the accuracy of the model.

Additionally, also note that a neural network can have hundreds of thousands of weights (and millions in certain architectures) that need to be adjusted, and thus, there is always a chance that one or the other weight can get updated to a very high number to fine-tune for one outlier row of the dataset.

主站蜘蛛池模板: 武义县| 鲜城| 长岭县| 珲春市| 兴和县| 合水县| 建湖县| 荣成市| 阿坝县| 舒兰市| 永登县| 稷山县| 祁连县| 阳东县| 赞皇县| 桐庐县| 靖边县| 文化| 勃利县| 东乌| 永年县| 绵竹市| 白沙| 黔江区| 巴东县| 广汉市| 增城市| 炎陵县| 鹤峰县| 彭州市| 涟源市| 炎陵县| 新沂市| 拉萨市| 马山县| 浑源县| 杂多县| 镇江市| 瓮安县| 保康县| 台安县|