LocallyConnceted 局部连接层
LocallyConnnected和Conv差不多,只是Conv每层共享卷积核, 这里不同位置卷积核独立
LocallyConnected1D层
1 | keras.layers.local.LocallyConnected1D( |
类似于Conv1D
,单卷积核权重不共享
LocallyConnected2D层
1 | keras.layers.local.LocallyConnected2D( |
类似Conv2D
,区别是不进行权值共享
- 说明
- 输出的行列数可能会因为填充方法而改变
- 例
1
2
3
4
5
6
7
8
9
10model = Sequential()
model.add(LocallyConnected2D(64, (3, 3), input_shape=(32, 32, 3)))
# apply a 3x3 unshared weights convolution with 64 output filters on a 32x32 image
# with `data_format="channels_last"`:
# now model.output_shape == (None, 30, 30, 64)
# notice that this layer will consume (30*30)*(3*3*3*64) + (30*30)*64 parameters
model.add(LocallyConnected2D(32, (3, 3)))
# now model.output_shape == (None, 28, 28, 32)
# add a 3x3 unshared weights convolution on top, with 32 output filters:
LocallyConnceted 局部连接层
https://xyy15926.github.io/Python/Keras/locally_connected_layers.html