demo-link: https://cs.stanford.edu/people/karpathy/convnetjs/demo/cifar10.html
网络结构:
------------------------------------------------------------------------------------
layer_defs = [];
layer_defs.push({type:'input', out_sx:32, out_sy:32, out_depth:3});
layer_defs.push({type:'conv', sx:5, filters:16, stride:1, pad:2, activation:'relu'});
layer_defs.push({type:'pool', sx:2, stride:2});
layer_defs.push({type:'conv', sx:5, filters:20, stride:1, pad:2, activation:'relu'});
layer_defs.push({type:'pool', sx:2, stride:2});
layer_defs.push({type:'conv', sx:5, filters:20, stride:1, pad:2, activation:'relu'});
layer_defs.push({type:'pool', sx:2, stride:2});
layer_defs.push({type:'softmax', num_classes:10});
net = new convnetjs.Net();
net.makeLayers(layer_defs);
trainer = new convnetjs.SGDTrainer(net, {method:'adadelta', batch_size:4, l2_decay:0.0001});
------------------------------------------------------------------------------------
输入图: 32 x 32 x 3
第一层卷积: 原始图片经过卷积后的特征图conv_1_map : 32 x 32 x 16
conv_1_map经过ReLU后的结果ReLU_1_map: 32 x 32 x 16
ReLU_1_map经过pooling后的结果pooling_1_map : 16 x 16 x 16
第二层卷积: pooling_1_map经过卷积后的特征图 conv_2_map : 16 x 16 x 20
conv_2_map经过ReLU后的结果ReLU_2_map: 16 x 16 x 20
ReLU_2_map经过pooling后的结果pooling_2_map : 8 x 8 x 20
第三层卷积: pooling_2_map经过卷积后的特征图 conv_3_map : 8 x 8 x 20
conv_3_map经过ReLU后的结果ReLU_3_map: 8 x 8 x 20
ReLU_3_map经过pooling后的结果pooling_3_map : 4 x 4 x 20
将pooling_3_map进行reshape操作后与10个隐层节点全连接, 10个隐层节点可视化:
softmax :