code_22.py 314 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4 5 6 7
index = np.arange(0, iterations, 1)
plt.plot(index, loss_history, c='blue', linestyle='solid')
plt.plot(index, loss_history_test, c='red', linestyle='dashed')
plt.legend(["Training Loss", "Test Loss"])
plt.xlabel("Number of Iteration")
plt.ylabel("Cost")
plt.show() # 同时显示训练集和测试集损失曲线