注意:把 fit 结果传递给 history
例如:
import matplotlib.pyplot as plt
history_dict = history.history
acc = history_dict['acc']
val_acc = history_dict['val_acc']
epochs = range(1, len(val_acc) + 1)
plt.plot(epochs, acc, 'b',color='orange', label='Tra_acc')
plt.plot(epochs, val_acc, 'b', label='Val_acc')
plt.legend()
plt.savefig('E:/dujuan_papers/result/50_acc.png',dpi=1000)
plt.show()
loss = history_dict['loss']
val_loss = history_dict['val_loss']
epochs = range(1, len(loss) + 1)
plt.plot(epochs, loss, 'b',color='orange', label='Tra_loss')
plt.plot(epochs, val_loss, 'b', label='Val_loss')
plt.legend()
plt.savefig('E:/dujuan_papers/result/50_loss.png',dpi=1000)
plt.show()
####结束