Activation function after pooling layer or convolutional layer?

Well, max-pooling and monotonely increasing non-linearities commute. This means that MaxPool(Relu(x)) = Relu(MaxPool(x)) for any input. So the result is the same in that case. So it is technically better to first subsample through max-pooling and then apply the non-linearity (if it is costly, such as the sigmoid). In practice it is often done the … Read more

What is the difference between UpSampling2D and Conv2DTranspose functions in keras?

UpSampling2D is just a simple scaling up of the image by using nearest neighbour or bilinear upsampling, so nothing smart. Advantage is it’s cheap. Conv2DTranspose is a convolution operation whose kernel is learnt (just like normal conv2d operation) while training your model. Using Conv2DTranspose will also upsample its input but the key difference is the … Read more

2-D convolution as a matrix-matrix multiplication [closed]

Yes, it is possible and you should also use a doubly block circulant matrix (which is a special case of Toeplitz matrix). I will give you an example with a small size of kernel and the input, but it is possible to construct Toeplitz matrix for any kernel. So you have a 2d input x … Read more

Understanding NumPy’s Convolve

Convolution is a mathematical operator primarily used in signal processing. Numpy simply uses this signal processing nomenclature to define it, hence the “signal” references. An array in numpy is a signal. The convolution of two signals is defined as the integral of the first signal, reversed, sweeping over (“convolved onto”) the second signal and multiplied … Read more

Tensorflow Strides Argument

The pooling and convolutional ops slide a “window” across the input tensor. Using tf.nn.conv2d as an example: If the input tensor has 4 dimensions: [batch, height, width, channels], then the convolution operates on a 2D window on the height, width dimensions. strides determines how much the window shifts by in each of the dimensions. The … Read more

Intuitive understanding of 1D, 2D, and 3D convolutions in convolutional neural networks [closed]

I want to explain with picture from C3D. In a nutshell, convolutional direction & output shape is important! ↑↑↑↑↑ 1D Convolutions – Basic ↑↑↑↑↑ just 1-direction (time-axis) to calculate conv input = [W], filter = [k], output = [W] ex) input = [1,1,1,1,1], filter = [0.25,0.5,0.25], output = [1,1,1,1,1] output-shape is 1D array example) graph … Read more