hello
hello

Reputation: 25

Downsampling output tensor before using it as an input to a new layer

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)

Upvotes: 0

Views: 6753

Answers (1)

maz
maz

Reputation: 1980

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.

Upvotes: 1

Related Questions