【代码】python 绘图(以faster rcnn 的 loss 曲线为例)


# -*- coding=utf-8 -*-'''
import matplotlib.pyplot as plt
import re

logs=open('loss').read()
#print logs

pattern = re.compile('\
.*?Iteration (\d+)\, loss = (.*?)\n',re.S)
result= re.findall(pattern,logs)
print len(result)
#end to end
img={}
c=0
iteration=[]
loss=[]


iteration=[]
loss=[]
for i in xrange(0,70000/20):  
    iteration.append(result[i][0])
    loss.append(result[i][1])
    
colors = 'navy'
plt.clf()
plt.plot(iteration, loss, lw=1, color=colors)
plt.xlabel('iteration')
plt.ylabel('loss')
plt.xlim([0.0, 70000.0])
plt.ylim([0.0, 1.5])
plt.title('End to end')
#plt.legend(loc="lower left")
plt.show()   

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM