未验证 提交 452caa09 编写于 作者: Z zhangchao 提交者: GitHub

Update plotlog.py

上级 cd9374fb
...@@ -79,10 +79,10 @@ def plot_metric(metric, ...@@ -79,10 +79,10 @@ def plot_metric(metric,
plt.figure() plt.figure()
plt.title(graph_title) plt.title(graph_title)
if line_num == 1: if line_num == 1:
plt.plot(batch_id, metric, line_style, line_label) plt.plot(batch_id, metric, line_style, label=line_label)
else: else:
for i in range(line_num): for i in range(line_num):
plt.plot(batch_id, metric[i], line_style[i], line_label[i]) plt.plot(batch_id, metric[i], line_style[i], label=line_label[i])
plt.xlabel('batch') plt.xlabel('batch')
plt.ylabel(graph_title) plt.ylabel(graph_title)
plt.legend() plt.legend()
...@@ -102,12 +102,12 @@ def main(): ...@@ -102,12 +102,12 @@ def main():
accuracy_sample = sample(accuracy, args.sample_rate) accuracy_sample = sample(accuracy, args.sample_rate)
plot_metric(loss_sample, batch_sample, 'loss', line_label='loss') plot_metric(loss_sample, batch_sample, 'loss', line_label='loss')
plot_metric(accuracy_sample, plot_metric(
accuracy_sample,
batch_sample, batch_sample,
'accuracy', 'accuracy',
line_style='g-', line_style='g-',
line_label='accuracy') line_label='accuracy')
if __name__ == '__main__': if __name__ == '__main__':
main() main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册