Commit d985fbcd authored by John Zhang's avatar John Zhang

showing percentage slow down

parent 9114aad6
......@@ -301,11 +301,12 @@ def plot(result_dic):
data = [(tgt, result_dic[tgt]['average'], result_dic[tgt]['std_dev'])
for tgt in targets]
data.sort(key=lambda (tgt, avg, std): avg)
ratio = [avg / data[0][1] for (_, avg, _std) in data]
for i, (tgt, avg, std_dev) in enumerate(data):
ax.bar(width / 2 + width * i, avg, width, color=colors[i], yerr=std_dev, label=tgt)
ax.text(width / 2 + width * i + 0.01, avg, "%.6f" % avg, color='#1d1f21', fontweight='bold')
ax.text(width * (i + 1), avg - std_dev, "%.6f" % std_dev, color='#1d1f21', fontweight='bold')
ax.text(width * (i + 1) - 0.02, avg / 2, "%.3fx" % ratio[i], color='#1d1f21', fontweight='bold')
# plt.legend(loc=2)
plt.xticks([width * (i + 1) for i in range(len(targets))], [tgt for (tgt, _, _) in data])
plt.title("%(test_name)s with input size %(input_size)d" % result_dic)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment