📜  绘制 keras 模型训练历史 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:05.432000             🧑  作者: Mango

代码示例1
history = model.fit()
print(history.history.keys())

import matplotlib.pylab as plt
from matplotlib.pyplot import figure
figure(figsize=(8, 6))
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()