def MEAN_Spot(opt): # channel 1 inputs1 = layers.Input(shape=(42,42,1)) conv1 = layers.Conv2D(3, (5,5), padding='same', activation='relu', kernel_regularizer=l2(0.001))(inputs1) bn1 = layers.BatchNormalization()(conv1) pool1 = layers.MaxPooling2D(pool_size=(3, 3), padding='same', strides=(3,3))(bn1) do1 = layers.Dropout(0.3)(pool1) # channel 2 inputs2 = layers.Input(shape=(42,42,1)) conv2 = layers.Conv2D(3, (5,5), padding='same', activation='relu', kernel_regularizer=l2(0.001))(inputs2) bn2 = layers.BatchNormalization()(conv2) pool2 = layers.MaxPooling2D(pool_size=(3, 3), padding='same', strides=(3,3))(bn2) do2 = layers.Dropout(0.3)(pool2) # channel 3 inputs3 = layers.Input(shape=(42,42,1)) conv3 = layers.Conv2D(8, (5,5), padding='same', activation='relu', kernel_regularizer=l2(0.001))(inputs3) bn3 = layers.BatchNormalization()(conv3) pool3 = layers.MaxPooling2D(pool_size=(3, 3), padding='same', strides=(3,3))(bn3) do3 = layers.Dropout(0.3)(pool3) # merge 1 merged = layers.Concatenate()([do1, do2, do3]) # interpretation 1 merged_conv = layers.Conv2D(8, (5,5), padding='same', activation='relu', kernel_regularizer=l2(0.1))(merged) merged_pool = layers.MaxPooling2D(pool_size=(2, 2), padding='same', strides=(2,2))(merged_conv) flat = layers.Flatten()(merged_pool) flat_do = layers.Dropout(0.2)(flat) # outputs outputs = layers.Dense(1, activation='linear', name='spot')(flat_do) #Takes input u, v, os model = keras.models.Model(inputs=[inputs1, inputs2, inputs3], outputs=[outputs]) model.compile( loss={'spot':'mse'}, optimizer=opt, metrics={'spot':tf.keras.metrics.MeanAbsoluteError()}, ) return model 每条语句后的特征图尺寸与通道数
时间: 2023-10-04 07:11:35 浏览: 33
libaio1和libmecab2.zip
以下是每个操作后的特征图尺寸和通道数:
- inputs1: (42, 42, 1)
- conv1: (42, 42, 3)
- bn1: (42, 42, 3)
- pool1: (14, 14, 3)
- do1: (14, 14, 3)
- inputs2: (42, 42, 1)
- conv2: (42, 42, 3)
- bn2: (42, 42, 3)
- pool2: (14, 14, 3)
- do2: (14, 14, 3)
- inputs3: (42, 42, 1)
- conv3: (42, 42, 8)
- bn3: (42, 42, 8)
- pool3: (14, 14, 8)
- do3: (14, 14, 8)
- merged: (14, 14, 24)
- merged_conv: (14, 14, 8)
- merged_pool: (7, 7, 8)
- flat: (392,)
- flat_do: (392,)
- outputs: 1
其中,特征图的尺寸在括号中给出,通道数在尺寸的第三个维度中给出。
阅读全文