目录

* 2D Convolution
<https://www.cnblogs.com/nickchen121/p/10925663.html#d-convolution>
* Kernel size
<https://www.cnblogs.com/nickchen121/p/10925663.html#kernel-size>
* Padding & Stride
<https://www.cnblogs.com/nickchen121/p/10925663.html#padding-stride>
* Channels <https://www.cnblogs.com/nickchen121/p/10925663.html#channels>
* For instance
<https://www.cnblogs.com/nickchen121/p/10925663.html#for-instance>
* LeNet-5 <https://www.cnblogs.com/nickchen121/p/10925663.html#lenet-5>
* Pyramid Architecture
<https://www.cnblogs.com/nickchen121/p/10925663.html#pyramid-architecture>
* layers.Conv2D
<https://www.cnblogs.com/nickchen121/p/10925663.html#layers.conv2d>
* weight & bias
<https://www.cnblogs.com/nickchen121/p/10925663.html#weight-bias>
* nn.conv2d <https://www.cnblogs.com/nickchen121/p/10925663.html#nn.conv2d>
* Gradient? <https://www.cnblogs.com/nickchen121/p/10925663.html#gradient>
* For instance
<https://www.cnblogs.com/nickchen121/p/10925663.html#for-instance-1>
2D Convolution



Kernel size



* 矩阵卷积


Padding & Stride



* 步长2


Channels



For instance

* x: [b,28,28,3]
* one k: [3,3,3]
* multi-k: [16,3,3,3]
* stride: 1
* padding: [1,1,1,1]
* bias: [16]
* out: [b,28,28,16]


LeNet-5



Pyramid Architecture

* 从底层的边缘颜色到高层抽象的概念(轮子、车窗)


layers.Conv2D
import tensorflow as tf from tensorflow.keras import layers x =
tf.random.normal([1, 32, 32, 3]) # padding='valid':输入和输出维度不同 layer =
layers.Conv2D(4, kernel_size=5, strides=1, padding='valid') out = layer(x)
out.shape TensorShape([1, 28, 28, 4]) # padding='same':输入和输出维度相同 layer =
layers.Conv2D(4, kernel_size=5, strides=1, padding='same') out = layer(x)
out.shape TensorShape([1, 32, 32, 4]) layer = layers.Conv2D(4, kernel_size=5,
strides=2, padding='same') out = layer(x) out.shape TensorShape([1, 16, 16, 4])
layer.call(x).shape TensorShape([1, 16, 16, 4])
weight & bias
layer = layers.Conv2D(4, kernel_size=5, strides=2, padding='same') out =
layer(x) out.shape TensorShape([1, 16, 16, 4]) # 5,5--》size,3--》通道数,4--》核数量
layer.kernel.shape TensorShape([5, 5, 3, 4]) layer.bias <tf.Variable
'conv2d_11/bias:0' shape=(4,) dtype=float32, numpy=array([0., 0., 0., 0.],
dtype=float32)>
nn.conv2d
w = tf.random.normal([5, 5, 3, 4]) b = tf.zeros([4]) x.shape TensorShape([1,
32, 32, 3]) out = tf.nn.conv2d(x, w, strides=1, padding='VALID') out.shape
TensorShape([1, 28, 28, 4]) out = out + b out.shape TensorShape([1, 28, 28, 4])
out = tf.nn.conv2d(x, w, strides=2, padding='VALID') out.shape TensorShape([1,
14, 14, 4])
Gradient?

\[ \frac{\partial{Loss}}{\partial{w}} \]



For instance


友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信