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

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
主站蜘蛛池模板: 台北市| 成都市| 双峰县| 西宁市| 定安县| 鹤峰县| 长子县| 荥阳市| 清丰县| 金门县| 乌海市| 建平县| 巴林右旗| 兴和县| 札达县| 聂拉木县| 翁源县| 双桥区| 论坛| 宜宾县| 乌海市| 罗源县| 淮滨县| 察雅县| 吐鲁番市| 崇礼县| 广丰县| 镶黄旗| 淮南市| 寿宁县| 满城县| 宜宾市| 舞阳县| 盱眙县| 宝坻区| 武清区| 罗江县| 开阳县| 扶绥县| 孝昌县| 秦安县|