Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- train_acc = model.evaluate(x_train, y_train, batch_size=32)
- test_acc = model.evaluate(x_test, y_test, batch_size=32)
- fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(18, 10))
- ax1.plot(model.fit(x_train, y_train, epochs=50, batch_size=32).history['loss'], color='b', label="Training loss : {:0.4f}".format(train_acc[0]))
- ax1.plot(model.fit(x_train, y_train, epochs=50, batch_size=32).history['val_loss'], color='r', label="validation loss : {:0.4f}".format(test_acc[0]))
- ax1.set_xticks(np.arange(1, 50, 1))
- ax1.set_yticks(np.arange(0, 1., 0.1))
- ax1.legend()
- ax2.plot(model.fit(x_train, y_train, epochs=50, batch_size=32).history['accuracy'], color='b', label="Training accuracy : {0:.4f}".format(train_acc[1]))
- ax2.plot(model.fit(x_train, y_train, epochs=50, batch_size=32).history['val_accuracy'], color='r',label="Validation accuracy : {0:.4f}".format(test_acc[1]))
- ax2.set_xticks(np.arange(1, 50, 1))
- ax2.set_yticks(np.arange(0.4, 1.2, 0.1))
- legend = plt.legend(loc='best', shadow=True)
- plt.tight_layout()
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement