Olá, Embora o número de exemplos para rodar o fit seja de 60000, ele treina com apenas 1875 e depois com 20% para validação e 80% para treino (48000), ele roda com apenas 1500. Os valores da perda e da acurácia estão completamente diferentes do exemplificado em aula..
modelo =keras.Sequential([
keras.layers.Flatten(input_shape=(28,28)), #entrada
keras.layers.Dense(256, activation = tensorflow.nn.relu),
keras.layers.Dense(10,activation=tensorflow.nn.softmax)
])
modelo.compile(optimizer='adam', loss = 'sparse_categorical_crossentropy', metrics =['accuracy'])
historico = modelo.fit(imagens_treino, identificacoes_treino, epochs = 5)
Epoch 1/5
1875/1875 [==============================] - 11s 6ms/step - loss: 0.9763 - accuracy: 0.6935
Epoch 2/5
1875/1875 [==============================] - 10s 5ms/step - loss: 0.5919 - accuracy: 0.7866
Epoch 3/5
1875/1875 [==============================] - 9s 5ms/step - loss: 0.5249 - accuracy: 0.8133
Epoch 4/5
1875/1875 [==============================] - 10s 6ms/step - loss: 0.4887 - accuracy: 0.8278
Epoch 5/5
1875/1875 [==============================] - 11s 6ms/step - loss: 0.4645 - accuracy: 0.8365
________________________________________________________________________________________________________________
Epoch 1/5
1500/1500 [==============================] - 10s 6ms/step - loss: 1.0631 - accuracy: 0.6643 - val_loss: 0.6856 - val_accuracy: 0.7572
Epoch 2/5
1500/1500 [==============================] - 9s 6ms/step - loss: 0.6285 - accuracy: 0.7721 - val_loss: 0.5784 - val_accuracy: 0.7892
Epoch 3/5
1500/1500 [==============================] - 7s 5ms/step - loss: 0.5546 - accuracy: 0.8022 - val_loss: 0.5289 - val_accuracy: 0.8085
Epoch 4/5
1500/1500 [==============================] - 9s 6ms/step - loss: 0.5125 - accuracy: 0.8175 - val_loss: 0.5022 - val_accuracy: 0.8219
Epoch 5/5
1500/1500 [==============================] - 10s 7ms/step - loss: 0.4859 - accuracy: 0.8298 - val_loss: 0.4805 - val_accuracy: 0.8257