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

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
主站蜘蛛池模板: 昭通市| 屏南县| 芜湖县| 九龙城区| 刚察县| 宜都市| 通海县| 威海市| 武隆县| 清苑县| 仙游县| 贵州省| 新巴尔虎左旗| 阳城县| 赤壁市| 大化| 肥城市| 确山县| 五华县| 上思县| 洱源县| 隆回县| 英山县| 新余市| 东莞市| 广水市| 池州市| 杨浦区| 盱眙县| 衡水市| 固安县| 永善县| 象州县| 长丰县| 梁河县| 永州市| 乌苏市| 凌云县| 包头市| 普宁市| 淮安市|