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

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
主站蜘蛛池模板: 湟中县| 林芝县| 天门市| 平舆县| 仪征市| 郎溪县| 阳泉市| 宁海县| 桃园市| 长治市| 海原县| 当雄县| 泊头市| 宜春市| 荥经县| 哈巴河县| 札达县| 湄潭县| 娱乐| 泸州市| 噶尔县| 秦皇岛市| 河北区| 客服| 津南区| 盐山县| 泽库县| 孝昌县| 昭通市| 和平县| 新建县| 芷江| 柞水县| 霞浦县| 平定县| 永登县| 金堂县| 南澳县| 茂名市| 英超| 松滋市|