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
0
votes
0 answers

why did i get an Error saying 'Negative dimension size caused by subtracting 2 from 1' from MaxPooling2D

I was writing a Convolution Neural Network code and this happened, the error continued even after changing the convolutions, I kept getting same errors inp = Input(shape = (depth, height, width)) conv_1 = Convolution2D(conv_depth_1, kernel_size,…
0
votes
0 answers

DenseNet121 (PyTorch) : On the BatchNorm2d and Global Average Pooling layers

Running the following code from torchvision import models dnet121 = models.densenet121(pretrained = True) dnet121 yields a DenseNet121 description which ends as follows : Based on this, I would appreciate your assistance of the following: As per…
0
votes
0 answers

Patch Merging and Pooling layer difference

I want to ask what the difference between Patch Merging in Swin Transformer and Pooling layer (e.x. Max Pooling) in CNNs. Why do they use Patch Merging instead of Pooling layer. I understand that Patch Merging will reduce the spatial dimension in…
0
votes
0 answers

The output to a MaxPool Layer in a FCN

The input to a FCN is a 2D array of dimensions (1,48,28) as shown in the image below. The first layer is a Convulational layer with 64 kernels ans padding "same" and the output thus has the dimensions as that of the input but with 64 channels. Image…
0
votes
1 answer

TensorFlow 2d Pooling but only in 1 axis

I'm creating a SSL neural network and my input tensor is a NxM tensor where N is the length of the sound wave and M is the number of microphones. The actual size is roughly 14000x4 I need to pool, but I only want to pool the rows for each column…
a_person
  • 21
  • 2
0
votes
0 answers

Channel Max pooling and Channel dropout

Do we need to reweight the output of max pooling layer by the probability of presence when testing? In theory, the max-pooling will be impacted by the dropout ratio. The background is that I'm reading the paper(https://arxiv.org/pdf/2111.14973.pdf).…
0
votes
0 answers

Max pooling using numpy

I am trying to implement max pooling using numpy and below is my snippet. However I am getting an error cannot reshape array of size 2883 into shape (2,3,31,31) My input is 2X3X32X32. my method call is maxpool(x, kernel_size=2, stride=1,…
0
votes
1 answer

Min and Max pooling in tensorflow

I want to create a custom min max pooling layer in tensorflow. What do i mean by that is as max pooling takes the maximum value in a matrix of size k I want to implement a layer which gets the min and max values in a matrix of size k and then…
0
votes
1 answer

Implementing Custom Min_MAX_Pooling Layer in Tensorflow

Hi i am trying to implement coustom min max plooing layer in tensorflow using lambda layers to reduce noise in time series data. Here is the function that dose the min max pooling def min_max_pooling(sequence, window=5): output =…
AB Music Box
  • 81
  • 1
  • 6
0
votes
1 answer

I want to add some error percentage to the output of max-pooling layer?

I want to add some error percentage (relative error) to the output of max-pooling layer in CNN. I am using max pooling layer from keras. Below is the code i = Input(shape=x_train[0].shape) x = Conv2D(32, (3, 3), activation='relu',…
0
votes
0 answers

Average and standard deviation pooling that ignores zero values, in tensorflow

I am trying to apply average, and standard deviation pooling, to each dimension across each vector in a batch, while ignoring any zero values. Below is a minimum viable reproducible example of my code: import tensorflow as tf av_pool =…
Lorcán
  • 555
  • 3
  • 15
0
votes
1 answer

Using MaxPooling3D after ConvLSTM3D with return_sequences=True

I'm working on next frame prediction problem for 3D spatial data. Something simular, but for 2D data was discussed here https://keras.io/examples/vision/conv_lstm/. Basically, I have a set of 3D images which are changing over time, and I'm trying to…
0
votes
1 answer

How can I speed up max pooling clusters of different sizes and shapes of an image?

I have clustered the pixels of an image into clusters of different sizes and shapes. I want to max pool each cluster as fast as possible because the max pooling happens in one layer of my CNN. To clarify: Input is a batch of images with the…
0
votes
1 answer

Things I am Confused about

I am a little confused about a few things, and I was wondering if I could get some help. the necessity of softmax layers: I thought that for classification models the softmax layer converts creates percentage probabilities for each class in the…
0
votes
1 answer

Convert Keras (TensorFlow) MaxPooling3d to PyTorch MaxPool3d

I'm Trying to convert some Keras (TensorFlow) code to Pytorch, and I'm unable to reproduce the MaxPooling3d in Keras (TensorFlow) as MaxPool3d in PyTorch. The following code: import torch import torch.nn as nn import tensorflow.keras.layers as…
ido4848
  • 213
  • 3
  • 6