For questions about max pooling (as well as average pooling) operation, commonly used in convolutional neural networks for downsampling.
Questions tagged [max-pooling]
157 questions
2
votes
0 answers
Custom minmax pooling
I created a custom pooling layer using tensorflow layer subclassing. Here is the code:
class Min_Max_Pooling(tf.keras.layers.Layer):
def __init__(self, filter_size):
super(Min_Max_Pooling, self).__init__()
self.filter_size =…

AB Music Box
- 81
- 1
- 6
2
votes
1 answer
Efficient pooling operation in Tensorflow : Custom pooling layer
I wish to create a custom pooling layer which can efficiently work on GPUs.
For instance, I have following input tensor
in =

uselessrunner
- 125
- 6
2
votes
1 answer
While running a Pytorch CNN built with Sequential I am receiving an error "Shapes Cannot be Multiplied" but I checked that the shapes match
I am very perplexed why I am having a shape error after verifying the output shapes of layers. Can anyone please help identify where I am going wrong?
Based upon the summary of layers I included it seems like the error is occurring between layer 6…

Logan C
- 21
- 3
2
votes
1 answer
Upsampling with pooling indices keras (unpooling)
I start by saying that I'm kinda new to deep learning
I'm trying to write a segnet in keras that uses pooling indices to upsample.
I'm using this function with a Lambda Layer to perform a max pooling and save pooling indices:
def pool_argmax2D(x,…

cappadavide
- 113
- 1
- 8
2
votes
1 answer
ValueError: Input 0 of layer sequential_9 is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: [None, None, None]
I'm trying to solve classification problem. I don't know why I'm getting this error:
ValueError: Input 0 of layer sequential_9 is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: [None, None, None]
This is the…

Edayildiz
- 545
- 7
- 16
2
votes
1 answer
Max pool a single image in tensorflow using "tf.nn.avg_pool"
I want to apply "tf.nn.max_pool()" on a single image but I get a result with dimension that is totally different than the input:
import tensorflow as tf
import numpy as np
ifmaps_1 = tf.Variable(tf.random_uniform( shape=[ 7, 7, 3], minval=0,…

mnabil
- 695
- 1
- 5
- 19
2
votes
5 answers
What is K Max Pooling? How to implement it in Keras?
I have to add a k-max pooling layer in CNN model to detect fake reviews. Please can you let me know how to implement it using keras.
I searched the internet but I got no good resources.

Avik Nayak
- 21
- 1
- 3
2
votes
2 answers
Custom pooling layer - minmax pooling - Keras - Tensorflow
I want to define my custom pooling layer, instead of returning the max values like the MaxPooling layer, it would output the k maximum values and the k minimum values.
I am using Tensorflow as the backend.
I need the output vector to be sorted.
I…

Robin
- 605
- 2
- 8
- 25
2
votes
0 answers
significance of max pooling in lstm for sentiment Analysis
Can someone explain significance of max pooling layer after lstm layer in case of sentiment analysis?
How does it improves encoding of whole sentence in case of just considering output of final time step vs output of max pooling?

rajamohan reddy
- 101
- 1
- 4
2
votes
1 answer
Max pooling layer after 1D convolution layer
I'm new to Tensorflow. I'm trying to add a max pooling layer after a 1D convolution layer:
import tensorflow as tf
import math
sess = tf.InteractiveSession()
length=458
# These will be inputs
## Input pixels, image with one channel (gray)
x =…

H.H
- 188
- 1
- 13
2
votes
1 answer
Keras max_pool3d got an expected keyword argument 'data_format'
I am running a workshop with students using Keras, and all of the students have the same anaconda3 installation in windows.
The following code is giving an error for most of the students except 2 of them:
import numpy as np
import matplotlib.pyplot…

fartagaintuxedo
- 749
- 10
- 28
2
votes
3 answers
Usage of argmax from tf.nn.max_pool_with_argmax tensorflow
I am trying to use the argmax result of tf.nn.max_pool_with_argmax() to index another tensor. For simplicity, let's say I am trying to implement the following:
output, argmax = tf.nn.max_pool_with_argmax(input, ksize, strides,…

Mathew
- 307
- 1
- 11
1
vote
0 answers
How to fix this error using Maxpooling in CNN?
The last two maxPooling, are not working.
THE CODE:
input_shape = (48,48,1)
output_class = 7
model = Sequential()
model.add(Conv2D(128, kernel_size=(3,3), activation='relu', input_shape=input_shape))
model.add(BatchNormalization())
…

Amit
- 11
- 2
1
vote
0 answers
Pytorch setting elements to zero with "tensor index"
I've used Pytorch for a few months. But I recently want to create a customized pooling layer which is similar to the "Max-Pooling Dropout" layer and I think Pytorch provided us a bunch of tools to build such a layer I need. Here is my approach:
use…

FortCpp
- 906
- 2
- 12
- 28
1
vote
1 answer
Accuracy impact when not using stride and padding for maxpooling layers in a CNN
I'm testing parameters out for my CNN that aims at classifying images according to three classes.
Images are 224x224, the CNN architecture is very basic and consists of 3 convolutional layers (32, 32 and 64 filters) with ReLU activation after which…

Makuruku
- 11
- 1