1. 程式人生 > 其它 >【575】連續卷積層

【575】連續卷積層

  對於連續的卷積層,filter 的維度是跟輸入影象的維度一致

model = Sequential([
    Conv2D(8, 3, input_shape=(28, 28, 1), use_bias=False),
    Conv2D(16, 3, use_bias=False)
])

model.summary() 

  輸出

Model: "sequential_1"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
conv2d_3 (Conv2D)            (None, 26, 26, 8)         72        
_________________________________________________________________
conv2d_4 (Conv2D)            (None, 24, 24, 16)        1152      
=================================================================
Total params: 1,224
Trainable params: 1,224
Non-trainable params: 0
_________________________________________________________________

  其中:

  • 第一層的filter為 3x3x1x8=72(原始資料是 28x28x1,得到資料 26x26x8)

  • 第二層的filter為 3x3x8x16=1152(上一個資料是 26x26x8,得到資料 24x24x16)