神经网络计算公式
神经网络计算公式
参数说明
名称 | 含义 |
---|---|
K_h | 卷积核的高 |
K_w | 卷积核的宽 |
C_in | 输入通道数 |
C_out | 输出通道数 |
out_width | 输出图像的宽度 |
out_height | 输出图像的高度 |
in_width | 输入图像的宽度 |
in_height | 输入图像的高度 |
P | padding,为填充大小 |
S | stride,为步长 |
一、卷积神经网络
参数量:
Params = K_h × K_w × C_in × C_out + C_out
其中,K_h × K_w × C_in × C_out代表权重数,C_out 代表偏置数卷积后输出图像大小
out_width = (in_width - K_w + 2P)/ S + 1(向下取整)
out_height = (in_height - K_h + 2P) / S + 1(向下取整)池化后输出图像大小
out_width = (in_width - K_w )/ S + 1(向下取整)
out_height = (in_height - K_h ) / S + 1(向下取整)
二、全连接神经网络
- 参数量:
Params = C_in × C_out + C_out
其中 C_in × C_out 代表权重数,C_out代表偏置数