lenet的結構:
data(28*28)---卷積層1(20個5*5的卷積核,偏移1)--->20*24*24---池化層1(大小2,偏移2)--->20*12*12---卷積層2(50個5*5的卷積核,偏移1)
-->50*8*8---池化層2(大小2,偏移2)--->50*4*4---IP1(全連接層,輸出500)--->500*1---IP2(全連接層,輸出10)--->10*1---label--->loss
其中存在理解問題的點:
1、data(28*28)---卷積層1(20個5*5的卷積核,偏移1)--->20*24*24
偏移量1,一個卷積核生成一個24*24的數據,24=28-5+1,故生成的數據位20*24*24
2、20*12*12---卷積層2(50個5*5的卷積核,偏移1)-->50*8*8
理解的是20個12*12的數據都經過一個卷積核後進行累加形成一個8*8的數據,有50個卷積核,故輸出50*8*8
3、50*4*4---IP1(全連接層,輸出500)--->500*1
50*4*4展開是800個數據,輸出是500,參數實際上有800*500
4、爲什麼用兩個全連接層?
5、全連接層的作用?
6、卷積層概括結構信息,池化層概括平移信息,理解縮放及平移的表示....
7、從網絡結構看,沒有旋轉不變的特性,那種layers可以實現呢?
優化:
訓練好模型後,測試會發現我們使用畫圖工具寫的數字識別率並不高,我覺得很大部分原因是訓練集與我們寫的分佈實際上是
不一致的,爲了增強泛化能力,加入了dropout層:
...
layer {
name: "ip1"
type: "InnerProduct"
bottom: "pool2"
top: "ip1"
param {
lr_mult: 1
}
param {
lr_mult: 2
}
inner_product_param {
num_output: 500
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
}
layer {
name: "relu1"
type: "ReLU"
bottom: "ip1"
top: "ip1"
}
layer {
name: "drop6"
type: "Dropout"
bottom: "ip1"
top: "ip1"
dropout_param {
dropout_ratio: 0.4
}
}
layer {
name: "ip2"
type: "InnerProduct"
bottom: "ip1"
top: "ip2"
param {
lr_mult: 1
}
param {
lr_mult: 2
}
inner_product_param {
num_output: 10
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
}
...
測試了0.3,0.4,0.5,0.6,0.7, 0.4是效果最好的,直接用畫圖工具寫的識別率有所上升,上個圖