网上看到:
实验结果:best_acc= 94.71%(14层残差)
天啊!要训练110轮,才会有质的飞跃!
我似乎缺乏这样的耐心,so,我就停留在85,困住了!近期最好成绩84.95!
带senet,也取得最好成绩83.18!创造这些最好成绩 的还是我那三残差网络,只不过,我优化了很多细节,最近的要算一些参数的0初始化!感受还是在稳定性上!
另外就是std和mean的使用!
第三,就是lr作了调整!
近期最大的感受就是稳定是突破的基石!网络架构还是这个得分最高,就在这上头想办法:
layers.emplace_back(std::make_shared<Conv2D>(cudnn, batch, 5, 32, 32, 32, 3, 1, 1));
layers.emplace_back(std::make_shared<BN>(cudnn, batch, 32, 32, 32));
layers.emplace_back(std::make_shared<LeakyRL>(cudnn, batch, 32, 32, 32));
layers.emplace_back(std::make_shared<Conv2D>(cudnn, batch, 32, 64, 32, 32, 3, 1, 1));
layers.emplace_back(std::make_shared<residualExt22>(cudnn, batch, 64, 32, 32));
layers.emplace_back(std::make_shared<MaxPool2D>(cudnn, batch, 64, 32, 32, 2, 2, 0, 2));
layers.emplace_back(std::make_shared<Conv2D>(cudnn, batch, 64, 128, 16, 16, 3, 1, 1));
layers.emplace_back(std::make_shared<residualExt22>(cudnn, batch, 128, 16, 16));
layers.emplace_back(std::make_shared<MaxPool2D>(cudnn, batch, 128, 16, 16, 2, 2, 0, 2));
layers.emplace_back(std::make_shared<Conv2D>(cudnn, batch, 128, 256, 8, 8, 3, 1, 1));
layers.emplace_back(std::make_shared<residualExt22>(cudnn, batch, 256, 8, 8));
layers.emplace_back(std::make_shared<MaxPool2D>(cudnn, batch, 256, 8, 8, 2, 2, 0, 2));
// layers.emplace_back(std::make_shared<Conv2D>(cudnn, batch, 256, 300, 4, 4, 4));
layers.emplace_back(std::make_shared<Linear>(cublas, batch, 256*4*4, 300));
layers.emplace_back(std::make_shared<BN>(cudnn, batch, 300, 1, 1));
layers.emplace_back(std::make_shared<LeakyRL>(cudnn, batch, 300, 1, 1));
layers.emplace_back(std::make_shared<Linear>(cublas, batch, 300, 10));
最初就是他带我上了83.24分!
lr调整后如此:一直用lr=0.001,当train到达82分,做如下部署:
if (chengji[0] >= 82)
// if (chengji[0] >= 85)
{
起作用++;
lr = 0.0001;
if (起作用 >= 3)//执行2次
{
lr = 0.00001;//这个83.32分,创纪录了
if (起作用 >= 5)//执行2次
{
lr = 0.000001;
if (起作用 >= 7)//执行2次
{
lr = 0.0000001;
if (起作用 >= 9)//退出
{
i = 100;
}
}
}
}
}
0初始化如卷积层:(不再使用非零初始化!)
zero_kernel << <(b_size + 255) / 256, 256 >> > (_grad_bias, b_size);
zero_kernel << <(w_size + 255) / 256, 256 >> > (_grad_weight, w_size);
zero_kernel << <(_batch * _out_channels * _out_h * _out_w + 255) / 256, 256 >> > (_output, _batch * _out_channels * _out_h * _out_w);
zero_kernel << <(_batch * _in_channels * _in_h * _in_w + 255) / 256, 256 >> > (_grad_input, _batch * _in_channels * _in_h * _in_w);
训练节点(拐点)如下:(验证以上细节的调整)
时间: 27331.929688 ms
train Classification result: 97.50% ok (used 49984 images)
时间: 2145.236084 ms
Test Classification result: 82.30% ok (used 9984 images)
learn rate:0.0001
轮次:24
均值: -90.0030059814,方差:14.0249986649
均值: -87.6609115601,方差:11.1409282684
均值: -91.4050750732,方差:8.6625871658
均值: -88.7697906494,方差:13.2397594452
均值: -89.5710449219,方差:13.7450332642
均值: -90.1831817627,方差:7.1279768944
均值: -89.8954620361,方差:15.9475574493
均值: -91.6007232666,方差:19.2678642273
均值: -92.5446090698,方差:11.0975723267
均值: -89.4845657349,方差:10.7211999893
均值: -89.1439590454,方差:9.4157590866
均值: -91.4487915039,方差:24.4504737854
均值: -88.1308135986,方差:13.0858469009
均值: -91.8805236816,方差:15.4056463242
均值: -91.4631423950,方差:13.5508584976
均值: -92.0959930420,方差:15.5257358551
均值: -89.3520660400,方差:7.0764660835
均值: -89.7229003906,方差:13.0267095566
均值: -90.1392745972,方差:11.5007438660
均值: -89.8574676514,方差:15.2681083679
均值: -94.0932998657,方差:12.7880811691
均值: -91.9308776855,方差:12.9652538300
均值: -89.5239181519,方差:19.1181278229
均值: -88.7568893433,方差:17.2236022949
均值: -89.1051712036,方差:18.5954170227
均值: -89.2031173706,方差:11.1493854523
均值: -90.2933273315,方差:15.7165937424
均值: -92.2265319824,方差:17.1336555481
均值: -88.4247970581,方差:14.2746744156
均值: -87.0833587646,方差:8.2819252014
均值: -92.9659652710,方差:12.1669368744
均值: -88.0147323608,方差:12.5158348083
时间: 27362.111328 ms
train Classification result: 98.10% ok (used 49984 images)
时间: 2152.024902 ms
Test Classification result:83.86% ok (used 9984 images)
learn rate:1e-05
轮次:25
。。。
时间: 27535.343750 ms
train Classification result: 97.72% ok (used 49984 images)
时间: 2174.266113 ms
Test Classification result: 81.56% ok (used 9984 images)
learn rate:0.0001
轮次:24
rb均值: 1.6140453815,rb方差:5.120904445648
均值: -93.1453933716,方差:16.6951541901
均值: -89.5411300659,方差:13.9249677658
均值: -91.6143341064,方差:10.9254045486
均值: -88.4864883423,方差:17.3460960388
均值: -92.7311325073,方差:16.6858062744
均值: -90.4656372070,方差:6.9966602325
均值: -91.2220077515,方差:20.6955375671
均值: -92.4978637695,方差:28.9232978821
均值: -95.8759613037,方差:15.1841077805
均值: -88.2818069458,方差:13.0533695221
均值: -84.8050689697,方差:11.1592187881
均值: -90.9559707642,方差:26.2159500122
均值: -90.2095413208,方差:21.0307292938
均值: -94.9991760254,方差:18.5383968353
均值: -88.7679290771,方差:15.3791704178
均值: -94.6937179565,方差:24.2541046143
均值: -87.7234725952,方差:7.5897364616
均值: -89.1307373047,方差:18.1437034607
均值: -89.9150695801,方差:13.0529365540
均值: -92.5738677979,方差:17.3618869781
均值: -95.2071914673,方差:20.6090621948
均值: -92.9055862427,方差:11.8797712326
均值: -91.4030151367,方差:24.5985851288
均值: -90.6616897583,方差:18.5187110901
均值: -89.8819732666,方差:19.0706024170
均值: -86.7467422485,方差:11.9170856476
均值: -88.7020034790,方差:14.6680479050
均值: -93.5892105103,方差:21.0500984192
均值: -89.5009918213,方差:15.7073564529
均值: -88.4498672485,方差:9.8511447906
均值: -92.2534332275,方差:11.2799034119
均值: -89.2119445801,方差:14.4264163971
时间: 27513.873047 ms
train Classification result: 98.23% ok (used 49984 images)
时间: 2177.084961 ms
Test Classification result:84.59% ok (used 9984 images)
learn rate:1e-05
轮次:25
。。。
时间: 27585.908203 ms
train Classification result: 97.12% ok (used 49984 images)
时间: 2171.240967 ms
Test Classification result: 84.87% ok (used 9984 images)
learn rate:1e-05
轮次:24
均值: -89.1569442749,方差:21.8877449036
均值: -87.1171264648,方差:18.0932846069
均值: -90.3414459229,方差:14.8263645172
均值: -88.9296646118,方差:21.0110893250
均值: -91.0140609741,方差:23.3084144592
均值: -89.8222656250,方差:13.7696933746
均值: -89.2569656372,方差:24.2851676941
均值: -91.3925323486,方差:20.1694049835
均值: -90.6773681641,方差:14.6891994476
均值: -89.3500137329,方差:13.7939796448
均值: -82.7095794678,方差:12.1913690567
均值: -90.9668884277,方差:34.9290504456
均值: -88.0935821533,方差:23.3173236847
均值: -89.6331863403,方差:29.2646942139
均值: -86.8041687012,方差:19.7180480957
均值: -93.5874633789,方差:28.8533210754
均值: -87.7150115967,方差:10.0918579102
均值: -85.8822174072,方差:13.8620977402
均值: -86.9596557617,方差:22.7990703583
均值: -89.3087921143,方差:27.7217559814
均值: -91.4010162354,方差:24.4388103485
均值: -90.3860702515,方差:15.0780963898
均值: -88.7416839600,方差:31.9720840454
均值: -88.3724517822,方差:23.9765300751
均值: -87.4666137695,方差:22.2937946320
均值: -87.9431304932,方差:18.5732898712
均值: -86.9548416138,方差:23.0292987823
均值: -91.6506729126,方差:26.3199367523
均值: -87.4069747925,方差:19.6056785583
均值: -87.0255661011,方差:10.2156801224
均值: -91.9443283081,方差:20.2376461029
均值: -85.8004989624,方差:14.2750272751
时间: 27673.296875 ms
train Classification result: 97.24% ok (used 49984 images)
时间: 2174.523926 ms
Test Classification result:84.92% ok (used 9984 images)
learn rate:1e-06
轮次:25
以前还有耐心训练110轮,现在感觉25轮都出成绩了,还要110轮吗?
自己的这个架构在110轮能突破吗?
感觉在磨人性!