博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
可视化_将两条曲线画在一个图中
阅读量:379 次
发布时间:2019-03-05

本文共 1281 字,大约阅读时间需要 4 分钟。

# 我们来显示验证和训练的损失曲线(见图 6-20)。# # 代码清单 6-38 绘制结果import matplotlib.pyplot as pltloss = history.history['loss']val_loss = history.history['val_loss']epochs = range(len(loss))plt.figure()plt.plot(epochs, loss, 'bo', label='Training loss')plt.plot(epochs, val_loss, 'b', label='Validation loss')plt.title('Training and validation loss')plt.legend()plt.show()# 图 6-20 简单的密集连接网络在耶拿温度预测任务上的训练损失和验证损失print(history.history)

在这里插入图片描述

print(history.history){
'val_loss': [0.8748725497482347, 0.3975294645299217, 0.3109697792993953, 0.32736822754454703, 0.32925783149578325, 0.3136130665345372, 0.3221883660155713, 0.3522020755638459, 0.32485968480552746, 0.3193821293605862, 0.3482952474704877, 0.34307795770766675, 0.32300440624104365, 0.3191545883966283, 0.33410712029247197, 0.34500235922256745, 0.3459017112153559, 0.35247658667855825, 0.3340611231497577, 0.3364521464519445], 'loss': [1.571558004796505, 0.4991003686189652, 0.3011927672326565, 0.2678608466684818, 0.25595426523685455, 0.24517172515392305, 0.23824044767022132, 0.23298490041494369, 0.22821045821905137, 0.2227226406633854, 0.2185874055325985, 0.21574989056587218, 0.21279067119956016, 0.210872103959322, 0.20845433309674263, 0.20609600335359574, 0.20415313729643822, 0.20333791476488114, 0.20114947184920312, 0.19921788474917412]}

转载地址:http://gmrg.baihongyu.com/

你可能感兴趣的文章