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

How it works...

The key steps that we have performed in the preceding code are as follows:

  • We flattened the input dataset so that each pixel is considered a variable using the reshape method
  • Additionally, we scaled the dataset so that each variable now has a value between zero and one
    • We achieved the preceding by dividing the values of a variable with the maximum value of that variable
  • We performed one-hot encoding on the output values so that we can distinguish between different labels using the to_categorical method in the np_utils package
  • We built a neural network with a hidden layer using the sequential addition of layers
  • We compiled the neural network to minimize categorical cross entropy loss (as the output has 10 different categories) using the model.compile method
  • We fitted the model with training data using the model.fit method
  • We extracted the training and test losses accuracies across all the epochs that were stored in the history
  • We also identified a scenario that we consider overfitting
主站蜘蛛池模板: 巴东县| 富锦市| 尼勒克县| 鸡西市| 阳曲县| 凯里市| 凌源市| 五指山市| 商水县| 南宁市| 林周县| 新昌县| 仪征市| 萨迦县| 阿巴嘎旗| 淮南市| 扶沟县| 苍溪县| 民乐县| 汾西县| 天门市| 册亨县| 甘泉县| 元江| 桂阳县| 江门市| 济阳县| 宣恩县| 绩溪县| 东乡县| 肥城市| 孟津县| 闵行区| 突泉县| 孟村| 石屏县| 黄龙县| 长岛县| 土默特左旗| 高密市| 拜城县|