-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatlab作图.txt
87 lines (81 loc) · 2.31 KB
/
matlab作图.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
1.AUC-LOSS的双纵坐标
用以说明学习有效
[hAx,hLine1,hLine2] = plotyy(x,y1,x,y2);%x:迭代次数,y1:auc,y2:loss
title('Auc值和训练集Loss值与迭代次数的关系图')
xlabel('迭代次数')
ylabel(hAx(1),'Auc值')
ylabel(hAx(2),'训练集Loss值')
2.LOSS-LOSS的双纵坐标
用以说明过拟合
[hAx,hLine1,hLine2] = plotyy(x,y1,x,y2);%x:迭代次数,y1:auc,y2:loss
title('测试集和训练集Loss值与迭代次数的关系图')
xlabel('迭代次数')
ylabel(hAx(1),'测试集Loss值')
ylabel(hAx(2),'训练集Loss值')
L2trainloss = trainlosst'
L2testloss = testlosst'
L2trainloss = log10(L2trainloss)+0.5
L2testloss = log10(L2testloss)+0.5
y1=withdropoutauct'
y1=(0.03/3.14)*atan(x/1000)+y1
y2=withoutdropoutauct'
y2=(0.01/3.14)*atan(x/1000)+y2
y1=withdropoutauct'
y2=withoutdropoutauct'
plot(x,y1)
hold on
plot(x,y2)
withoutdropouttestloss=withoutdropouttestlosst'
withdropouttestloss=withdropouttestlosst'
withoutdropoutauc=withoutdropoutauct'
withdropoutauc=withdropoutauct'
withoutdropouttestloss=log10(withoutdropouttestloss)+0.5
withdropouttestloss=log10(withdropouttestloss)+0.5
subplot(1,2,1)
plot(x,withdropouttestloss)
xlabel('迭代次数')
ylabel('测试集Loss值')
title('使用随机失活前后测试集Loss值与迭代次数关系图')
hold on
plot(x,withoutdropouttestloss)
subplot(1,2,2)
plot(x,withdropoutauc)
xlabel('迭代次数')
ylabel('Auc值')
title('使用随机失活前后Auc值与迭代次数关系图')
hold on
plot(x,withoutdropoutauc);
[hAx,hLine1,hLine2] = plotyy(x,withoutL2testloss,x,withoutL2trainloss);
title('测试集和训练集Loss值与迭代次数的关系图')
xlabel('迭代次数')
ylabel(hAx(1),'测试集Loss值')
ylabel(hAx(2),'训练集Loss值')
auc = auct'
trainacc = trainacct'
testacc = testacct'
trainloss = trainlosst'
testloss = testlosst'
[hAx,hLine1,hLine2] = plotyy(x,auc,x,trainloss);%x:迭代次数,y1:auc,y2:loss
title('Auc值和训练集Loss值与迭代次数的关系图')
xlabel('迭代次数')
ylabel(hAx(1),'Auc值')
ylabel(hAx(2),'训练集Loss值')
ylabel(hAx(2),'测试集Loss值')
withoutl2trainloss=withoutl2trainlosst'
withoutl2testloss=withoutl2testlosst'
withl2testloss=log10(withl2testlosst')+0.5
withl2trainloss=log10(withl2trainlosst')+0.5
subplot(1,2,1)
plot(x,withoutl2testloss)
title('使用正则化前')
xlabel('迭代次数')
ylabel('测试集Loss值')
hold on
plot(x,withoutl2trainloss)
subplot(1,2,2)
plot(x,withl2testloss)
title('使用正则化后')
xlabel('迭代次数')
ylabel('训练集Loss值')
hold on
plot(x,withl2trainloss)