假设s这里误差单位1,到达,z 1(3),error is δ 1(3) =1 ,因为最后一个神经元没有非线性变换。
到达a1(2), error is δ 1(3)*w12
越过神经元maps z12 to a12,δ 1(2) = w1(2)* σ一撇 (z1 (2))
卷积的一些要点:
输入32*32*3,参数个数:5*5 (模板)* 3(前一通道厚度)=75
输入7*7 模板3*3 stride1,输出大小5*5;stride2,,输出3*3
input (不care前一层,只care有多少个模板) 32*32*3 receptive fields 5*5 stride 1 number neurons 5 output volume?
out = 28*28*5 weights :5*5*3*5 = 75
input 7*7 核 3*3 stride 1 pad with1 pixel 输出 7*7
227 *227 *3 11*11 1个 stride 4 no zero pad 输出:55*55 (227-11)/4+1,每一个卷积模板参数:11*11*3
例题;pytorch :nn.conv16 33 3 stride=2 ,pad =1),input = torch.randn(20,16,50,100)
output 20(batchsize )*33(output channel)*25*50
(3、2、1组合通常下采样2倍,3、1、1原来比例)
import torch import torch.nn as nn x = torch.randn(20, 16, 50, 100) # batch, channel , height , width print(x.shape) m = nn.Conv2d(16, 33, (3), (2),padding =1) # in_channel, out_channel ,kennel_size,stride print(m) y = m(x) print(y.shape)