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

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
主站蜘蛛池模板: 仪陇县| 淳化县| 滨州市| 泾川县| 陵水| 孟村| 嘉义县| 遂宁市| 政和县| 松江区| 宁陕县| 衡山县| 微博| 光山县| 徐水县| 乳山市| 景宁| 炉霍县| 蚌埠市| 炉霍县| 五峰| 正蓝旗| 闽清县| 桃江县| 镇原县| 岳普湖县| 彰武县| 临邑县| 西平县| 东兴市| 葫芦岛市| 垦利县| 固镇县| 屏南县| 桐乡市| 卢湾区| 兴和县| 安庆市| 花莲市| 宝鸡市| 仁怀市|