Reputation: 331
Anyone knows the algorithm for pytorch adaptive_avg_pool2d, for example,
adaptive_avg_pool2d(image,[14,14])
so question: I want to do the same in keras neural network, for any give inputs, want to get 14*14 output. Any suggestions?
Upvotes: 0
Views: 326
Reputation: 151
I don't think this exists in Keras. You could get the dimension of your input and divide by 14 to get the desired pool_size.
For example if your inputs are 28x28 you can use:
keras.layers.AveragePooling2D(pool_size=(2, 2), strides=None, padding='valid', data_format=None)
Upvotes: 1