x0 = Input((10,10,64))
x = Reshape((10,10,2,32), input_shape = (10,10,64))(x0)
交换位置拿到上下两层
x = Permute((1,2,4,3))(x)
x1 = Lambda(lambda z: K.expand_dims(z[:, :, :, :, 0], axis=-1))(x)
x2 = Lambda(lambda z: K.expand_dims(z[:, :, :, :, 1], axis=-1))(x)
上下分好层
x1 = Conv3D(2, kernel_size=(3, 3, 2), strides=(1, 1, 2), padding='same')(x1)
x2 = Conv3D(2, kernel_size=(3, 3, 2), strides=(1, 1, 2), padding='same')(x2)
对每一个info进行卷积,相当于group,进行Primary group convolution操作
x1 = Reshape((10,10,32), input_shape=(10, 10, 16, 2))(x1)
x2 = Reshape((10,10,32), input_shape=(10, 10, 16, 2))(x2)
分别卷积
x = concatenate([x1, x2],axis = -1)
卷积完 怼在一起
x = Reshape((10,10,2,32), input_shape = (10,10,64))(x)
x = Permute((1,2,4,3))(x)
进行 Secondary group convolution 操作
x = Conv3D(2, kernel_size=(3, 3, 1), strides=(1, 1, 1), padding='same')(x)
x = Reshape((10,10,64), input_shape = (10, 10, 32, 2))(x)
手工
visi = Model(x0, x)