本文主要内容是使用python matplotlib
绘制accuracy, cost曲线。在使用机器学习算法训练时往往需要输出训练的accuracy以及cost,但是最直观的方法还是绘制对应的曲线(根据训练的迭代期n),本文给出简要的绘制方法。
代码如下,也可见stackoverflow:
import numpy as np
import matplotlib.pyplot as plt
def draw_result(lst_iter, lst_loss, lst_acc, title):
plt.plot(lst_iter, lst_loss,