import matplotlib.pyplot as plt
import numpy as np
from matplotlib.font_manager import FontProperties
font = FontProperties(fname=r"c:\windows\fonts\SimSun.ttc", size=16)
def ReadTxtName(rootdir):
lines = []
with open(rootdir, 'r') as file_to_read:
while True:
line = file_to_read.readline()
if not line:
break
line = line.strip('\n')
lines.append(float(line))
return lines
resultpath = r'C:\Users\411\Desktop\loss\pspnetloss.txt' #四个网络loss值
resultpath2 = r'C:\Users\411\Desktop\loss\segnetloss.txt'
resultpath3 = r'C:\Users\411\Desktop\loss\unetloss.txt'
resultpath4= r'C:\Users\411\Desktop\loss\修改loss.txt'
lineslist = ReadTxtName(resultpath)
lineslist2 = ReadTxtName(resultpath2)
lineslist3 = ReadTxtName(resultpath3)
lineslist4 = ReadTxtName(resultpath4)
x=range(0,100) #100
y1=lineslist
y2=lineslist2
y3=lineslist3
y4=lineslist4
plt.title('Result Analysis',fontproperties=font)
plt.plot(x, y1,color=
绘制Loss对比曲线图
最新推荐文章于 2024-09-10 21:22:24 发布
该博客通过读取并绘制四个不同深度学习网络(PSPNet、SegNet、U-Net和改进Net)在100个epoch的训练过程中损失值的变化曲线,对比了它们的训练效果。结果显示,各网络的损失值随着时间推移呈现下降趋势,其中改进Net的损失最低,表明其可能具有更好的性能。

最低0.47元/天 解锁文章
190





