How to plot loss, val_loss as well as accuracy, val_accuracy without using history when I fit the model

Viewed 132
model.fit(X_train, y_train, batch_size=mini_batch_size, epochs=nb_epochs, validation_data=(X_test, y_test))

plt.title('Accuracy')
plt.plot(model['accuracy'], label='train')
plt.plot(model['val_accuracy'], label='test')
plt.legend()
plt.show()

ypeError: 'Functional' object is not subscriptable

enter image description here

1 Answers

As far as I know, there are some other alternatives:

  1. Tensorboard: Provides tools for visualizing, debugging, and understanding your models in the browser. take a look at this tutorial. enter image description here

  2. BaseLogger Class: You can code some model monitoring with this class. there is an example here.

  3. History Class: the callback that is used for keras models automatically and is actually that object that fit method returns.

Related