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

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
主站蜘蛛池模板: 万宁市| 泰来县| 扎鲁特旗| 绥芬河市| 宝坻区| 永安市| 从江县| 隆林| 静宁县| 卓尼县| 莱芜市| 石阡县| 宁安市| 大厂| 清流县| 大同市| 桓台县| 五峰| 墨玉县| 安宁市| 西乡县| 河池市| 都兰县| 永川市| 铅山县| 比如县| 洱源县| 微山县| 玉环县| 连江县| 吴江市| 淮阳县| 芦山县| 桂东县| 永年县| 哈密市| 元阳县| 天津市| 独山县| 贵阳市| 界首市|