如何在不使用Tensorboard的情况下在Tensorflow中绘制损耗曲线? [英] How to plot loss curve in Tensorflow without using Tensorboard?
问题描述
嘿,我是Tensorflow的新手.我使用DNN训练模型,我想绘制损耗曲线.但是,我不想使用Tensorboard,因为我对此并不熟悉.我想知道是否有可能在每个步骤中提取损失信息信息并使用其他绘图程序包或scikit-learn对其进行绘图?
Hey I am new to Tensorflow. I used DNN to train the model and I would like to plot the loss curve. However, I do not want to use Tensorboard since I am really not familiar with that. I wonder whether it is possible to extract the loss info info in each step and plot it use other plotting package or scikit-learn?
非常感谢!
推荐答案
更改您的sess.run(training_function, feed_dict)
语句,使其也包含损失函数.然后使用Matplotlib之类的东西来绘制数据.
Change your sess.run(training_function, feed_dict)
statement so it includes your loss function as well. Then use something like Matplotlib to plot the data.
_, loss = sess.run((training_function, loss_function), feed_dict)
loss_list.append(loss)
import matplotlib.pyplot as plt
plt.plot(loss_list)
这篇关于如何在不使用Tensorboard的情况下在Tensorflow中绘制损耗曲线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!