-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1048 lines (419 loc) · 40.4 KB
/
index.html
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html class="theme-next pisces use-motion">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />
<link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />
<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />
<meta name="keywords" content="Hexo, NexT" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />
<meta name="description">
<meta property="og:type" content="website">
<meta property="og:title" content="小酒馆">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="小酒馆">
<meta property="og:description">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="小酒馆">
<meta name="twitter:description">
<script type="text/javascript" id="hexo.configuration">
var NexT = window.NexT || {};
var CONFIG = {
scheme: 'Pisces',
sidebar: {"position":"left","display":"post"},
fancybox: true,
motion: true,
duoshuo: {
userId: 0,
author: '博主'
}
};
</script>
<title> 小酒馆 </title>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<div class="container one-collumn sidebar-position-left
page-home
">
<div class="headband"></div>
<header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-meta ">
<div class="custom-logo-site-title">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<span class="site-title">小酒馆</span>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<p class="site-subtitle">Learning</p>
</div>
<div class="site-nav-toggle">
<button>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
</button>
</div>
<nav class="site-nav">
<ul id="menu" class="menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section">
<i class="menu-item-icon fa fa-fw fa-home"></i> <br />
首页
</a>
</li>
<li class="menu-item menu-item-about">
<a href="/about" rel="section">
<i class="menu-item-icon fa fa-fw fa-user"></i> <br />
关于
</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives" rel="section">
<i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
归档
</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags" rel="section">
<i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
标签
</a>
</li>
</ul>
</nav>
</div>
</header>
<main id="main" class="main">
<div class="main-inner">
<div class="content-wrap">
<div id="content" class="content">
<section id="posts" class="posts-expand">
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2016/05/29/BingObjectnessCVPR14/" itemprop="url">
BingObjectnessCVPR14
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2016-05-29T19:05:05+08:00" content="2016-05-29">
2016-05-29
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p> 这篇CVPR2014的论文作者是程明明教授。这篇论文主要讲了一种物体检测的算法,其作用是找到图像当中的候选的物体区域,说白了就是一种一般物体检测的算法。<br> 一般物体检测的算法有许多种,以行人检测为例,传统的方法就是滑动窗口法。但是滑动窗口法也存在着许多问题。比如对于一幅NXN的图像来说,使用滑动窗口法所提取出的候选窗口有N^4的数量级之多。虽然可以通过一些特征和分类器对候选窗口进行过滤,但最终的结果仍然不是特别理想。而且传统的一些一般物体检测的算法在速度上也存在的一些不足。而程明明教授的这项工作使速度能达到300fps。<br> “物体”的最大特点就是有Well-defined closed boundary,而背景则是杂乱无章的。程明明教授在论文中提出,在梯度空间图(normed gradient space)上,无论物体是长的还是宽的,只要归一化到一个相同的尺度上(例如8<em>8),它们的就变得十分有共性了,这时用SVM分类器就能把物体和非物体区分出来。<br><img src="http://o6lsmmv4m.bkt.clouddn.com/bing.png" alt="BING"><br> 如上图所示,(a)中绿框代表背景,红框代表物体。如果把这些框resize成固定的大小(文中给定为8</em>8),再求出每个8<em>8这些块中每个点的梯度(Normed Gradient),则可以看出物体与背景的梯度模式的差别。如图(c)所示,左边红框中两个8</em>8的梯度特征图为物体,右边绿框中四个8<em>8的梯度特征图为背景,物体的梯度分布呈现出较为杂乱的模式,而背景的较为单一和清楚。<br> 作者为了得到如图(d)所示的8</em>8的梯度特征模型,采用了cascaded SVM(级联SVM)。第一级SVM对所有的候选窗口进行粗过滤,第二级SVM,则是对每一个size的窗口分别设计(也就是设计了36个不同的SVM),不同的size会是物体的概率是不一样的,正方形的窗口就更可能是物体,而长条形的窗口就不太可能是。为了获取不同size的候选框,作者采样首先对原始图像进行不同尺度的resize,然后用训练好的SVM在resize后的每个8<em>8的模板上进行卷积,达到效果。(以200</em>200的图像为例,如要检测每个32<em>32的窗口大小是否会是物体,一般的做法就是先算整个图的梯度,然后隔点取32</em>32大小的框,再把框中的子图归一化到8<em>8的大小,最后送到cascaded SVM当中看得分。而作者的做法则是先把图像resize到50</em>50,然后计算梯度,然后再逐点取8*8大小的框,送到cascaded SVM当中看得分。这两步骤效果是差不多的,只是计算梯度的尺度不一样,但是后者只用做一次resize)。</p>
</div>
<div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2016/05/06/Caffe训练过程-LeNet/" itemprop="url">
Caffe训练过程(LeNet)
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2016-05-06T21:06:13+08:00" content="2016-05-06">
2016-05-06
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="Training-LeNet-on-MNIST-with-Caffe"><a href="#Training-LeNet-on-MNIST-with-Caffe" class="headerlink" title="Training LeNet on MNIST with Caffe"></a>Training LeNet on MNIST with Caffe</h2><h3 id="网络结构文件"><a href="#网络结构文件" class="headerlink" title="网络结构文件"></a>网络结构文件</h3><h4 id="数据层定义:"><a href="#数据层定义:" class="headerlink" title="数据层定义:"></a>数据层定义:</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">layer { </span><br><span class="line"> name: <span class="string">"mnist"</span> </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"Data"</span> </span><br><span class="line"> transform_param { </span><br><span class="line"> scale: 0.00390625 </span><br><span class="line"> } </span><br><span class="line"> data_param { </span><br><span class="line"> <span class="built_in">source</span>: <span class="string">"mnist_train_lmdb"</span> </span><br><span class="line"> backend: LMDB </span><br><span class="line"> batch_size: 64 </span><br><span class="line"> } </span><br><span class="line"> top: <span class="string">"data"</span> </span><br><span class="line"> top: <span class="string">"label"</span> </span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<ul>
<li>本层读取类型为lmdb的数据,batch size 为64,输入的像素进行归一化(所以scale的值为1/256即0.00390625。</li>
<li>最后,本层产生两个blobs,一个是data,另一个是lable。</li>
</ul>
<h4 id="卷积层定义-第一个卷积层-:"><a href="#卷积层定义-第一个卷积层-:" class="headerlink" title="卷积层定义(第一个卷积层):"></a>卷积层定义(第一个卷积层):</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">layer { </span><br><span class="line"> name: <span class="string">"conv1"</span> </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"Convolution"</span> </span><br><span class="line"> param { </span><br><span class="line"> lr_mult: 1 </span><br><span class="line"> } </span><br><span class="line"> param { </span><br><span class="line"> lr_mult: 2 </span><br><span class="line"> } </span><br><span class="line"> convolution_param { </span><br><span class="line"> num_output: 20 </span><br><span class="line"> kernel_size: 5 </span><br><span class="line"> stride: 1 </span><br><span class="line"> weight_filler { </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"xavier"</span> </span><br><span class="line"> } </span><br><span class="line"> bias_filler { </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"constant"</span> </span><br><span class="line"> } </span><br><span class="line"> } </span><br><span class="line"> bottom: <span class="string">"data"</span> </span><br><span class="line"> top: <span class="string">"conv1"</span> </span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<ul>
<li>本层接data blob,产生conv1层。输出特征图个数20,卷积核大小为5*5,卷积步长为1。我们可以用fillers来随机初始化权重和偏置值。对于weight_filler,使用xavier算法,该算法可以根据输入输出神经元的个数自动初始化权重。对于bias filler使用constant初始化,其默认初始化值为0。lr_mult是可学习参数的学习率。在本例中,我们将权重的学习率与solver在运行时给出的学习率设为一样的。偏置值得学习率为其的两倍(这样做会得到更好的收敛率)。</li>
</ul>
<h4 id="池化层定义-第一个池化层-:"><a href="#池化层定义-第一个池化层-:" class="headerlink" title="池化层定义(第一个池化层) :"></a>池化层定义(第一个池化层) :</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">layer { </span><br><span class="line"> name: <span class="string">"pool1"</span> </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"Pooling"</span> </span><br><span class="line"> pooling_param { </span><br><span class="line"> kernel_size: 2 </span><br><span class="line"> stride: 2 </span><br><span class="line"> pool: MAX </span><br><span class="line"> } </span><br><span class="line"> bottom: <span class="string">"conv1"</span> </span><br><span class="line"> top: <span class="string">"pool1"</span> </span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<ul>
<li>本层采用最大池化,池化大小2*2,步长为2。产生pool1。</li>
<li>参照上面的方法,可以写出更多的卷积池化层,具体细节参考lenet_train_test.prototxt </li>
</ul>
<h4 id="全连接层定义-第一个-:"><a href="#全连接层定义-第一个-:" class="headerlink" title="全连接层定义(第一个):"></a>全连接层定义(第一个):</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">layer { </span><br><span class="line"> name: <span class="string">"ip1"</span> </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"InnerProduct"</span> </span><br><span class="line"> param { </span><br><span class="line"> lr_mult: 1 </span><br><span class="line"> } </span><br><span class="line"> param { </span><br><span class="line"> lr_mult: 2 </span><br><span class="line"> } </span><br><span class="line"> inner_product_param { </span><br><span class="line"> num_output: 500 </span><br><span class="line"> weight_filler { </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"xavier"</span> </span><br><span class="line"> } </span><br><span class="line"> bias_filler { </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"constant"</span> </span><br><span class="line"> } </span><br><span class="line"> } </span><br><span class="line"> bottom: <span class="string">"pool2"</span> </span><br><span class="line"> top: <span class="string">"ip1"</span> </span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<ul>
<li>全连接层输出为500,类型为InnerProduct。</li>
</ul>
<h4 id="ReLU层定义:"><a href="#ReLU层定义:" class="headerlink" title="ReLU层定义:"></a>ReLU层定义:</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">layer { </span><br><span class="line"> name: <span class="string">"relu1"</span> </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"ReLU"</span> </span><br><span class="line"> bottom: <span class="string">"ip1"</span> </span><br><span class="line"> top: <span class="string">"ip1"</span> </span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<ul>
<li>Bottom和top相同</li>
</ul>
<h4 id="全连接层定义-第二个"><a href="#全连接层定义-第二个" class="headerlink" title="全连接层定义(第二个):"></a>全连接层定义(第二个):</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">layer { </span><br><span class="line"> name: <span class="string">"ip2"</span> </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"InnerProduct"</span> </span><br><span class="line"> param { </span><br><span class="line"> lr_mult: 1 </span><br><span class="line"> } </span><br><span class="line"> param { </span><br><span class="line"> lr_mult: 2 </span><br><span class="line"> } </span><br><span class="line"> inner_product_param { </span><br><span class="line"> num_output: 10 </span><br><span class="line"> weight_filler { </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"xavier"</span> </span><br><span class="line"> } </span><br><span class="line"> bias_filler { </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"constant"</span> </span><br><span class="line"> } </span><br><span class="line"> } </span><br><span class="line"> bottom: <span class="string">"ip1"</span> </span><br><span class="line"> top: <span class="string">"ip2"</span> </span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<h4 id="Loss-层定义:"><a href="#Loss-层定义:" class="headerlink" title="Loss 层定义:"></a>Loss 层定义:</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">layer { </span><br><span class="line"> name: <span class="string">"loss"</span> </span><br><span class="line"> <span class="built_in">type</span>: <span class="string">"SoftmaxWithLoss"</span> </span><br><span class="line"> bottom: <span class="string">"ip2"</span> </span><br><span class="line"> bottom: <span class="string">"label"</span> </span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<ul>
<li>softmax_loss层实现了softmax 和 multinomial logistic loss。它承接了两个blobs,第一个是预测,第二个是数据层提供的标签。这一层不产生如何输出,其功能是计算损失函数值。当反向传播开始时调用这一层,开始对ip2计算梯度。</li>
</ul>
<h4 id="层规则:"><a href="#层规则:" class="headerlink" title="层规则:"></a>层规则:</h4><p>在定义层时可以加上Layer Rules来说明这一层在网络中的调用状态,比如:<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">layer { </span><br><span class="line"> // ...layer definition... </span><br><span class="line"> include: { phase: TRAIN } </span><br><span class="line">}</span><br></pre></td></tr></table></figure></p>
<ul>
<li>上面include后就是Layer Rules,说明该层将会在train阶段被调用。如果改为phase: TEST则说明该层只会在test时被调用。在没有include时,默认该层总被网络调用。在lenet_train_test.prototxt 中定义了两个DATA层(这两个层中batch_size值不一样),一个用于训练阶段,一个用于测试阶段。同样,Accuracy层只在测试阶段来得出每100次迭代后模型的精确度(在lenet_solver.prototxt定义)。</li>
</ul>
<h4 id="定义MNIST-Solver:"><a href="#定义MNIST-Solver:" class="headerlink" title="定义MNIST Solver:"></a>定义MNIST Solver:</h4><p>接下来开始编辑网络求解文件:lenet_solver.prototxt<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE%E7%89%871.png" alt=""></p>
<h3 id="开始训练:"><a href="#开始训练:" class="headerlink" title="开始训练:"></a>开始训练:</h3><p>训练命令:<br>./build/tools/caffe train –solver=examples/mnist/lenet_solver.prototxt<br>或者调用脚本:<br>cd $CAFFE_ROOT<br>./examples/mnist/train_lenet.sh </p>
<h3 id="结果如下:"><a href="#结果如下:" class="headerlink" title="结果如下:"></a>结果如下:</h3><p><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE%E7%89%872.png" alt=""></p>
<ul>
<li><p>这些信息包含了网络的初始化,层的传递等等。初始化结束后,开始训练。<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE%E7%89%873.png" alt=""></p>
</li>
<li><p>training loss function every 100 iterations, and test the network every 1000 iterations.<br>lr is the learning rate of that iteration, and loss is the training function.<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE%E7%89%873.png" alt=""></p>
</li>
<li><p>For the output of the testing phase, score 0 is the accuracy, and score 1 is the testing loss function.<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE%E7%89%874.png" alt=""></p>
</li>
<li><p>模型最终以二进制protobuf文件形式存储于lenet_iter_10000中。 </p>
</li>
</ul>
</div>
<div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2016/05/03/无参考视频质量评价/" itemprop="url">
无参考视频质量评价
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2016-05-03T21:16:58+08:00" content="2016-05-03">
2016-05-03
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="无参考视频质量评价"><a href="#无参考视频质量评价" class="headerlink" title="无参考视频质量评价"></a>无参考视频质量评价</h1><p> 根据失真视频与其相应的原始参考视频的比较程度,视频客观质量评估方法分为三大类:全参考方法(Full Reference)、部分参考方法(Reduced Reference)、无参考方法(No Reference)。三种方法如下图所示。</p>
<p> 无参考视频质量评价与全参考和部分参考质量评价模型相比,其输入只有失真图像和视频,输出是其质量分数,运算过程不需要任何原始信息,适合用于现实的应用场景,其原理图如下:</p>
<p> 目前的无参考视频质量评价方法,按照适用范围大致可分为两类:针对特定失真类型的专用型方法和适用于多种失真类型的通用型方法。</p>
<p>对于第一类方法:指定失真类型<br> 该方法采用量化已知类型的特有失真效果来评价图像质量。如针对模糊失真,在有模糊图像的基础上再加模糊和测量模糊图像边界延展性的方法;针对JPEG压缩失真,有计算块边界和块内活跃点及基于块边界方向统计的方法。</p>
<p>对于第二类方法:用于多种失真类型的通用型<br> 其又分为两种:<br> 基于训练学习的方法。这类方法首先提取图像的感知特征,然后利用训练学习算法来评价图像质量。例如,基于支持向量机学习的方法和基于神经网络训练的方法等。<br> 基于自然场景统计模型的方法。该方法假设自然图像或失真图像都只是所有图像信息的一个微小子集,然后试图通过寻找两者之间的差异来评价图像质量。</p>
</div>
<div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2016/05/03/DPM-部分形变模型/" itemprop="url">
DPM(部分形变模型)
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2016-05-03T21:16:12+08:00" content="2016-05-03">
2016-05-03
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
</div>
<div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2016/05/03/real-time-fire-and-flame detection/" itemprop="url">
real-time fire and flame detection
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2016-05-03T21:13:47+08:00" content="2016-05-03">
2016-05-03
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
</div>
<div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2016/05/03/Deep Learning学习笔记/" itemprop="url">
Deep Learning学习笔记
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2016-05-03T16:39:52+08:00" content="2016-05-03">
2016-05-03
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="一-感知机"><a href="#一-感知机" class="headerlink" title="一.感知机"></a>一.感知机</h2><h3 id="感知机模型"><a href="#感知机模型" class="headerlink" title="感知机模型"></a>感知机模型</h3><p><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE1.1.jpg" alt=""></p>
<ol>
<li>w和b根据网络情况不断进行调整</li>
<li>传入函数:最常用的只有按照权重求和</li>
<li>传输函数:有很多种</li>
</ol>
<p>常用传输函数列表:<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE1.2.jpg" alt=""><br> 其中Sigmoid函数,它接收任意实数输入,并将结果对应到0和1之间。该函数是可导的。因此,在BP神经网络中使用该函数。</p>
<h3 id="感知机的学习规则"><a href="#感知机的学习规则" class="headerlink" title="感知机的学习规则"></a>感知机的学习规则</h3><p>最简单的感知机学习规则:<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE1.3.png" alt=""><br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE1.4.png" alt=""><br>其中,各个符号的含义如下:<br> e:误差(e=t-a)<br> t:期望输出<br> a:实际输出<br> p:输入<br>其他感知机网络的学习算法:<br>1.LMS:<br>LMS学习算法的权值和偏置跟新公式为:<br>w(k+1)= w(k)+ƞe(k)p(k)<br>w(k+1)= w(k)+ƞe(k)p(k)<br>w为权值,e为误差,p为神经元输入,b为偏置,ƞ为学习率,通常取0到1之间的小数<br>2.反向传播算法</p>
<h2 id="二-多层感知机"><a href="#二-多层感知机" class="headerlink" title="二.多层感知机"></a>二.多层感知机</h2><p>感知机的局限性——只能处理线性可分的问题<br>多层感知机结构:<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.1.jpg" alt=""></p>
<h3 id="多层感知机学习算法:"><a href="#多层感知机学习算法:" class="headerlink" title="多层感知机学习算法:"></a>多层感知机学习算法:</h3><p><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.2.png" alt=""><br> 多层感知机网络中,误差要通过最后一层网络,逐层向前传播,用于调衡各层的权值连接。<br>反向传播算法:<br> 每一个输出的误差为:ti-aoi (t:期望输出,ao:输出层输出)<br> 神经网络均方误差为:<img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.3.jpg" alt=""><br> 使用梯度下降,要修正的权值就是e对w的偏导数:<img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.4.jpg" alt=""><br> η为学习步长<br> 所以得:<img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.5.jpg" alt=""><br>其中,各个符号的含义如下:<br> wih:输入层到中间隐层的权值<br> wha:中间隐层到输出层的权值<br> σh为第h个中间隐层神经元的对误差的敏感性<br> σi为第i个输出层神经元对误差的敏感性<br>使用反向传播算法的多层感知机神经网络叫做BP神经网络</p>
<h3 id="反向传播算法:"><a href="#反向传播算法:" class="headerlink" title="反向传播算法:"></a>反向传播算法:</h3><p>代价函数为:<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.6.png" alt=""><br>总代价函数为:<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.7.png" alt=""><br>第二项是规则化项(也叫权重衰减项) </p>
<p>梯度下降法中每一次迭代都按照如下公式对参数W和b进行更新:<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.8.png" alt=""><br>其中a是学习速率。</p>
<p>其中关键步骤是计算偏导数,反向传播是计算偏导数的一种有效方法。<br>总代价函数<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.10.png" alt=""><br>的偏导数:<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.9.png" alt=""></p>
<h3 id="反向传导算法的细节:"><a href="#反向传导算法的细节:" class="headerlink" title="反向传导算法的细节:"></a>反向传导算法的细节:</h3><p>1.进行前馈传导计算,利用前向传导公式,得到<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.11.png" alt=""><br>直到输出层<br><img src="http://o6lsmmv4m.bkt.clouddn.com/%E5%9B%BE2.12.png" alt="">的激活值。<br>2.对于第ni层(输出层)的每个输出单元i,我们根据以下公式计算残差:</p>
<h3 id="从浅层学习到深度学习:"><a href="#从浅层学习到深度学习:" class="headerlink" title="从浅层学习到深度学习:"></a>从浅层学习到深度学习:</h3><h2 id="三-稀疏自编码"><a href="#三-稀疏自编码" class="headerlink" title="三.稀疏自编码"></a>三.稀疏自编码</h2><h2 id="四-卷积神经网络"><a href="#四-卷积神经网络" class="headerlink" title="四.卷积神经网络"></a>四.卷积神经网络</h2>
</div>
<div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</section>
</div>
</div>
<div class="sidebar-toggle">
<div class="sidebar-toggle-line-wrap">
<span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
</div>
</div>
<aside id="sidebar" class="sidebar">
<div class="sidebar-inner">
<section class="site-overview sidebar-panel sidebar-panel-active ">
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image"
src="https://avatars0.githubusercontent.com/u/16175051?"
alt="Xue" />
<p class="site-author-name" itemprop="name">Xue</p>
<p class="site-description motion-element" itemprop="description"></p>
</div>
<nav class="site-state motion-element">
<div class="site-state-item site-state-posts">
<a href="/archives">
<span class="site-state-item-count">6</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags">
<span class="site-state-item-count">1</span>
<span class="site-state-item-name">标签</span>
</a>
</div>
</nav>
<div class="links-of-author motion-element">
</div>
</section>
</div>
</aside>
</div>
</main>
<footer id="footer" class="footer">
<div class="footer-inner">
<div class="copyright" >
©
<span itemprop="copyrightYear">2016</span>
<span class="with-love">
<i class="fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder">Xue</span>
</div>
<div class="powered-by">
由 <a class="theme-link" href="http://hexo.io">Hexo</a> 强力驱动
</div>
<div class="theme-info">
主题 -
<a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
NexT.Pisces
</a>
</div>
</div>
</footer>
<div class="back-to-top">
<i class="fa fa-arrow-up"></i>
</div>
</div>
<script type="text/javascript">
if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
window.Promise = null;
}
</script>
<script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
<script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="/vendors/velocity/velocity.min.js?v=1.2.1"></script>
<script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>