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

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
主站蜘蛛池模板: 六安市| 肃宁县| 从江县| 乳山市| 鹤壁市| 三都| 大方县| 商城县| 石河子市| 类乌齐县| 前郭尔| 政和县| 巍山| 巩义市| 和田县| 苏州市| 贺州市| 达拉特旗| 乌鲁木齐市| 廉江市| 三穗县| 崇仁县| 定日县| 石河子市| 黑龙江省| 太白县| 龙海市| 海门市| 郴州市| 榆中县| 雅江县| 正定县| 马公市| 沈丘县| 武鸣县| 正镶白旗| 阳城县| 丘北县| 临高县| 广州市| 高清|