1

I am looking at the following snippet of code:

c4 = Conv2D(64, (3, 3), activation='relu', padding='same') (p3)
c4 = Conv2D(64, (3, 3), activation='relu', padding='same') (c4)
p4 = MaxPooling2D(pool_size=(2, 2)) (c4)

c5 = Conv2D(128, (3, 3), activation='relu', padding='same') (p4)
c5 = Conv2D(128, (3, 3), activation='relu', padding='same') (c5)

u6 = Conv2DTranspose(64, (2, 2), strides=(2, 2), padding='same') (c5)
u6 = concatenate([u6, c4])
c6 = Conv2D(64, (3, 3), activation='relu', padding='same') (u6)
c6 = Conv2D(64, (3, 3), activation='relu', padding='same') (c6)

from this post. I am aware of this post explaining this concatenation but I'm not quite grasping what is happening. So, during a particular convolutional layer, $x$ kernals will create $x$ feature maps. These feature maps are "concatenated" to the up sampling layer's feature maps. But what exactly does that mean?

Does it mean that, for that upsampling layer, instead of trying to learn 64 features maps, it uses the exact 64 from the convolutional layer? Or does it mean that the up sampling layer has its own 64 feature maps and the 64 feature maps from the convolutional layer are somehow "combined" with these 64? If so, how exactly is it being combined?

Christian
  • 1,382
  • 3
  • 16
  • 27
  • they want you to move this to stackoverflow. They say that cv is more stats/math and not about software. – EngrStudent May 17 '18 at 15:04
  • I agree actually. I've flagged it for moderator intervention. – Christian May 17 '18 at 15:46
  • 1
    Oddly perhaps, I disagree. 'What does it mean that these are being concatenated to the feature maps' is a question about understanding how this type of ANN works, not really about how to code this. I think this is on topic here. – gung - Reinstate Monica May 17 '18 at 15:59

1 Answers1

2

Yes, it means the 64 transpose conv feature maps are being combined with the 64 other feature maps from a previous layer. It is being combined by concatenation -- in other words simply stacking them together so you have 128 feature maps.

shimao
  • 22,706
  • 2
  • 42
  • 81