0
votes

I am trying to merge two layers using the functional API. Now my output shape from one layer is not the same as the output shape from the other layer. How may I go about downsampling or compressing the one with the higher image dimension?

eg - downsample=(Merge([layerone,layersix],mode='concat')) layerthree1=Convolution2D(128, 3, 3,activation='relu')(downsample)

1

1 Answers

1
votes

Common methods for downsampling are max pooling, and average pooling layers(https://keras.io/layers/pooling/)

If what you need is to reduce size of the image a fixed number (rather than halve it or divide by a number) you could use a convolution with a border_mode='valid' for side pixel you want to remove.