ompile 26 test ml model in keras

Solutions on MaxInterview for ompile 26 test ml model in keras by the best coders in the world

showing results for - "ompile 26 test ml model in keras"
Dana
12 Jul 2019
1(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()
2
3x_train = x_train.reshape(60000, 784).astype("float32") / 255
4x_test = x_test.reshape(10000, 784).astype("float32") / 255
5
6model.compile(
7    loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),
8    optimizer=keras.optimizers.RMSprop(),
9    metrics=["accuracy"],
10)
11
12history = model.fit(x_train, y_train, batch_size=64, epochs=2, validation_split=0.2)
13
14test_scores = model.evaluate(x_test, y_test, verbose=2)
15print("Test loss:", test_scores[0])
16print("Test accuracy:", test_scores[1])
17
similar questions
queries leading to this page
ompile 26 test ml model in keras