分类两条直线y=0和y=x*tanθ,
设r为0到1之间的随机数,两个训练集为
A:[[r][r*tanθ]
B:[r][0]
训练集有5000个,测试集初始化方式相同,有1000个。
网络结构为
收敛标准从0.5-1e-4,共16个收敛标准,每个收敛标准收敛199次,统计平均值。θ从10到350共有32个值。共收敛了32*16*199次。
观察网络的迭代次数是如何随着θ的改变而改变的。
数据表格
| 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 100 | 110 | 120 | 130 | 140 | 150 | 160 | 170 | 190 | 200 | 210 | 220 | 230 | 240 | 250 | 260 | 280 | 290 | 300 | 310 | 320 | 330 | 340 | 350 |
δ | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n | 迭代次数n |
0.5 | 195.3317 | 198.0754 | 157.6432 | 135.6131 | 109.7889 | 97.42714 | 72.41709 | 36.61307 | 31.77889 | 75.9196 | 103.3518 | 91.22613 | 118.407 | 141.9296 | 180.8945 | 220.9548 | 175.3317 | 169.603 | 151.7286 | 132.2111 | 80.53769 | 85.11558 | 76.45226 | 43.9799 | 43.38693 | 60.45729 | 93.25628 | 115.0653 | 142.7638 | 141.6131 | 198.7337 | 201.7437 |
0.4 | 13914.29 | 6238.05 | 4033.643 | 2535.312 | 1726.704 | 1186.769 | 719.3216 | 352.6985 | 326.6533 | 712.3015 | 1183.181 | 1713.543 | 2665.688 | 3767.573 | 6406.779 | 14131.71 | 14513.17 | 6469.362 | 3712.377 | 2558.819 | 1774.955 | 1177.97 | 738.7136 | 360.8794 | 345.1508 | 726.6935 | 1170.754 | 1801.859 | 2534.94 | 3807.482 | 6263.241 | 13953.42 |
0.3 | 15479.9 | 6880.447 | 4314.97 | 2875.08 | 1991.296 | 1433.704 | 943.6281 | 550.6734 | 537.206 | 927.4472 | 1436.005 | 2005.688 | 2904.95 | 4326.799 | 7092.92 | 15352.95 | 15828.34 | 7207.407 | 4280.477 | 2905.291 | 1995.302 | 1365.608 | 926.2161 | 550.2261 | 551.6533 | 926.1106 | 1374.543 | 1969.181 | 2854.638 | 4348.296 | 7014.372 | 15623.51 |
0.2 | 16439.69 | 7453.307 | 4676.276 | 3160.387 | 2190.97 | 1625.216 | 1172.698 | 829.4322 | 792.809 | 1161.095 | 1610.412 | 2313.342 | 3237.151 | 4708.729 | 7503.362 | 16668.35 | 17014.31 | 7809.156 | 4654.045 | 3265.834 | 2267.121 | 1598.603 | 1189.804 | 786.3769 | 810.1608 | 1168.784 | 1611.04 | 2278.844 | 3176.864 | 4650.327 | 7539.683 | 16186.92 |
0.1 | 17919.78 | 8359.814 | 5291.221 | 3667.03 | 2638.603 | 2058.513 | 1536.347 | 1112.829 | 1116.719 | 1504.347 | 2001.141 | 2615.673 | 3714.839 | 5351.764 | 8178.975 | 17654.81 | 18440.28 | 8570.09 | 5176.899 | 3672.869 | 2699.02 | 1934.538 | 1498.281 | 1179.724 | 1219.583 | 1566.337 | 1950.065 | 2628.94 | 3601.472 | 5212.307 | 8356.849 | 18137.86 |
0.01 | 22466.49 | 10807.97 | 7469.513 | 5596.93 | 4627.839 | 3859.342 | 3361.714 | 3373.261 | 3130.035 | 3677.377 | 3937.111 | 4609.623 | 5599.352 | 7404.98 | 10909.85 | 22333.64 | 22566.98 | 11233.77 | 7381.844 | 5608.055 | 4598.362 | 3856.548 | 4436.608 | 4165.668 | 3228.794 | 3790.955 | 3726.744 | 4560.789 | 5529.422 | 7406.422 | 10770.9 | 22136.5 |
0.001 | 29045.94 | 16087.35 | 12214.04 | 10616.67 | 9757.819 | 10020.35 | 11161.16 | 52953.74 | 30886.15 | 10725.99 | 9588.814 | 10233.06 | 10915.11 | 12154.33 | 15966.08 | 29443.16 | 29662.3 | 16204.87 | 12123.7 | 10728.71 | 10144.03 | 9265.98 | 9767.955 | 40860.69 | 27934.85 | 10644.34 | 9200.06 | 10061.53 | 10669.82 | 12118.55 | 16012.09 | 28558.85 |
9.00E-04 | 29906.22 | 16205.63 | 12414.62 | 11048.55 | 10249.3 | 9974.377 | 12840.99 | 32423.63 | 69727.28 | 11143.14 | 10130.93 | 10492.75 | 11330.62 | 12524.45 | 16315.51 | 29979.6 | 30114.91 | 16524.46 | 12456.86 | 11204.39 | 10473.9 | 9534.101 | 11885.01 | 29902.56 | 42065.91 | 11187.51 | 9696.09 | 10372.28 | 11021.08 | 12422.62 | 16464.74 | 29512.95 |
8.00E-04 | 30505.62 | 16730.83 | 12846.1 | 11500.53 | 10718.98 | 10449.65 | 10274.39 | 50047.21 | 22749.25 | 12309.07 | 10513.88 | 10991.35 | 11740.57 | 12941.65 | 16602.16 | 30174.19 | 30631.14 | 16917.49 | 12932.58 | 11518 | 10773.39 | 9895.116 | 11344.74 | 40052.26 | 51881.49 | 9800.09 | 10291.73 | 10812.21 | 11393.32 | 12991.64 | 16670.48 | 29615.91 |
7.00E-04 | 30878.16 | 17098.47 | 13142.76 | 12078.96 | 11400.84 | 11165.35 | 11746.1 | 46881.28 | 29219.01 | 11548.01 | 11167.45 | 11310.91 | 12349.44 | 13389.07 | 17058.72 | 30827.22 | 31302.73 | 17200.23 | 13269.82 | 12124.67 | 11100.07 | 10716.31 | 11559.13 | 34973.5 | 25655.78 | 12788.38 | 11415.21 | 11380.51 | 11897.51 | 13437.53 | 17166.15 | 30572.86 |
6.00E-04 | 31735.77 | 17696.11 | 13751.94 | 12778.49 | 12138.33 | 11835.68 | 13506.68 | 43265.07 | 58553.6 | 12512.39 | 11808.45 | 11886.3 | 12950.76 | 13877.09 | 17620.75 | 31522.76 | 31610.18 | 17922.39 | 13852.37 | 12693.26 | 11883.21 | 12214.49 | 11677.46 | 35671.03 | 64251.91 | 11230.14 | 12521.11 | 12228.15 | 12669.77 | 13910.53 | 17700.87 | 30899.94 |
5.00E-04 | 32248.65 | 18160.16 | 14352.14 | 13474.12 | 12806.03 | 12512.8 | 13329.56 | 19513.03 | 59224.43 | 16901.82 | 12651.84 | 12745.24 | 13859.97 | 14401.74 | 18307.13 | 32465.1 | 32552.29 | 18456.9 | 14614.96 | 13634.92 | 12887.25 | 13418.06 | 13367.04 | 38435.47 | 42394.26 | 14905.44 | 13005.3 | 13377.39 | 13589.15 | 14619.36 | 18203.93 | 32070.51 |
4.00E-04 | 33464.13 | 19170.51 | 15337.98 | 14424.92 | 14200.39 | 13589.12 | 14980.47 | 45571.48 | 60102.32 | 17157.57 | 14247.02 | 14223.89 | 14849.99 | 15113.84 | 18904.38 | 33212.31 | 33518.07 | 19342.46 | 15453.51 | 14744.36 | 14233.24 | 14479.19 | 15331.63 | 45132.32 | 39034.05 | 14730.45 | 14746.82 | 14687.08 | 14433.19 | 15425.19 | 19210.96 | 33230.69 |
3.00E-04 | 34532.6 | 20339.17 | 16654.45 | 15992.67 | 15477.73 | 16568.63 | 17935.51 | 32716.51 | 38947.18 | 15841.03 | 15278.81 | 15971.04 | 16196.7 | 16659.85 | 20064.71 | 34419.91 | 35243.98 | 20352.41 | 16645.13 | 15725.6 | 15932.52 | 16824.29 | 18251.16 | 50232.28 | 65534.15 | 16970.77 | 15538.96 | 16528.97 | 16241.62 | 16750.31 | 20295.76 | 34232.78 |
2.00E-04 | 37157.44 | 22060.26 | 18760.1 | 18567.65 | 18526.91 | 19728.33 | 21393.43 | 85402.25 | 41534.36 | 21412.18 | 20275.08 | 18604.46 | 18489.37 | 18997.44 | 21990.85 | 35925.2 | 36928.21 | 22214.2 | 18753.98 | 17449.03 | 19393.23 | 19266.34 | 21286.21 | 44564.16 | 47518.88 | 19542.49 | 18753.08 | 19352.96 | 18648.54 | 18746.47 | 21862.37 | 36171.3 |
1.00E-04 | 40897.64 | 25703.87 | 22880.25 | 23550.47 | 24741.73 | 26411.01 | 26570.07 | 78260.95 | 78524.66 | 29832.78 | 25279.78 | 24705.55 | 23927.27 | 23034.28 | 25414.78 | 40711.15 | 41047.39 | 25718.63 | 23009.71 | 23444.37 | 24825.76 | 27288.6 | 32539.15 | 58313.76 | 75453.45 | 27253.39 | 26135.43 | 26387.03 | 23973.38 | 22846.3 | 25862.5 | 39897.13 |
将迭代次数曲线画成图
可以看到明显的对称关系,有两个小峰位于0和180位置,有两个大峰位于90,270.
由假设1:完全相同的两个对象无法被分成两类,与之对应的分类迭代次数为无穷大,分类准确率是50%,50%。相等收敛标准下迭代次数越大表明二者差异越小。
两个对象之间的差异越小迭代次数越大,这个假设可以很好的解释0和180的两个小峰,因为θ越小,两条直线的夹角越小,越相似。
但如何解释位于90和270的两个大峰?如果θ接近90或270将与y=0垂直,直观上这应该是两条直线差异最大的情况,按照假设1应该迭代次数变小才对。
但想象两条垂直的直线只有1个交点,而两条重合的直线有无数的交点,1个点和1条线之间的差异小于两条线之间的差异似乎也是合理的。由此两个90和270的大峰也得以解释。