绘制loss曲线

  • 从log文件中析取各部分loss值
    cat filename | grep smoothed_loss | awk '{print $11}' > smoothed_loss.txt
  • 列表内容

绘制各个部分曲线的code

from pylab import *
import pylab as pl
values = []
with open('./baseline7/cls_loss.txt') as file:
    lines = file.readlines()
    for line in lines:
        line = line.strip()
            values.append(line)
#pl.ylim(0.0, 1)  
plot(values, color="blue", linewidth=1.0, linestyle="-")
show()

你可能感兴趣的:(python)