Questions tagged [max-pooling]

For questions about max pooling (as well as average pooling) operation, commonly used in convolutional neural networks for downsampling.

157 questions
1
vote
1 answer

Maxpool of an image in pytorch

I'm trying to just apply maxpool2d (from torch.nn) on a single image (not as a maxpool layer). Here is my code right now: name = 'astronaut' imshow(images[name], name) img = images[name] # pool of square window of size=3, stride=1 m =…
user11764168
1
vote
2 answers

PyTorch MaxPool2D unexpected behavior with padding=1

I was playing around with MaxPool2D in PyTorch and discovered strange behavior when setting padding=1. Here is what I got: Code: import torch from torch.nn.functional import max_pool2d TEST = 1 def test_maxpool(negative=False, tnsr_size=2,…
trsvchn
  • 8,033
  • 3
  • 23
  • 30
1
vote
1 answer

Batch Normalization when CNN with only 2 ConvLayer?

I wonder if it is a problem to use BatchNormalization when there are only 2 convolutional layers in a CNN. Can this have adverse effects on classification performance? Now I don't mean the training time, but really the accuracy? Is my network…
1
vote
2 answers

How do covolution2d and maxpolling2d apply on input in Keras?

I'm new to all the stuff I'm going to talking about so that the questions may be too simple. Thanks in advance for your answers! My questions cames from the following image: To be more clear: For the first Convolution, from 1 x 28 x28 to 25 x 26…
1
vote
2 answers

tf.keras embedding with mask_zero=True followed by GlobalAveragePooling1D generate TypeError

I am on tensorflow v2 on google colab using tf.keras. I am trying to use embedding with masking follow by global average. Here's my code: vocab_size = 1500 inputs = Input(shape=(None,), dtype=tf.int32, name='word_sequence') x =…
kawingkelvin
  • 3,649
  • 2
  • 30
  • 50
1
vote
1 answer

Is it possible to extend "im2col" and "col2im" to N-D images?

"Im2col" has already been implemented, Implement MATLAB's im2col 'sliding' in Python, efficiently for 2-D images in Python. I was wondering whether it is possible to extend this to arbitrary N-D images? Many applications involve high-dimensional…
QRabbani
  • 41
  • 1
  • 4
1
vote
1 answer

strides should be of length 1, 1 or 3 but was 2

I have been trying to stack Convolutional neural networks with GRUs for an image to text problem. Here's my model : model=Sequential() model.add(TimeDistributed(Conv2D(16,kernel_size (3,3),data_format="channels_last",input_shape=…
lazypanda
  • 21
  • 1
  • 3
1
vote
0 answers

Layer Max_pooling1d_1 Does Not Support Masking

I tried to build an LSTM model with return_sequences=True, that is I wanna get all the outputs of LSTM cell, but when I preprocessed the sequential data with the function Masking(), an error happened. Any apply is appreciate:) Here is my code in…
Yongfeng
  • 345
  • 1
  • 3
  • 15
1
vote
2 answers

How to do tensorflow segment_max in high dimension

I want to be able to call tensorflow's tf.math.unsorted_segment_max on a data tensor that is of size [N, s, K]. N is the number of channels and K is the number of filters/feature maps. s is the size of one-channel data sample. I have segment_ids in…
Polhek
  • 67
  • 1
  • 7
1
vote
1 answer

maxpooling results not displaying in model.summary() output

I am beginner in Keras. I am tring to build a model for which i am using Sequential model. When i am tring to reduce the input size from 28 to 14 or lesser by using maxpooling function then the maxpooling function results does't display on call to…
User
  • 79
  • 2
  • 8
1
vote
1 answer

expected conv2d_7 to have shape (220, 220, 1) but got array with shape (224, 224, 1)

I am following the tutorial from keras blog (https://blog.keras.io/building-autoencoders-in-keras.html) to build an autoencoder. I used my own dataset and I am using the following code on my 224*224 size image. input_img = Input(shape=(224,224,1)) #…
nzy
  • 854
  • 2
  • 15
  • 28
1
vote
1 answer

Does a maxpooling layer reduce the number of parameters in a network?

I have a simple network defined: model = Sequential() model.add(Conv1D(5, 3, activation='relu', input_shape=(10, 1),name="conv1",padding="same")) model.add(MaxPooling1D()) model.add(Conv1D(5, 3,…
vampiretap
  • 351
  • 3
  • 13
1
vote
0 answers

how max pool layer decrease/increase the numbers of feature channels?

When reading some deep learning papers, which sometimes mentioned that max-pooling layer for downsampling can also be used for decreasing/increasing the number of feature channels(maps). This confused me a lot. It looks to me the max-pooling layer…
1
vote
2 answers

What is the pool size of global pooling operations?

In normal pooling operations we have to mention pool size for pooling operation, like for 2D pooling operations we mention (2,2); however, in global pooling operation it is not required. So is it the same size as input? I am working on Keras. Here…
1
vote
1 answer

merge three images with Tensorflow with indices

I have a problem with using Tensorflow. I have four images with their corresponding indices. I want to make an image from them. I tried for loops, tf.gather, tf.assign, and so on but all show error. If somebody help me, it would be really…