Questions tagged [convolution]

A mathematical operation that combines two signals to generate a third signal. Convolution often arises in audio processing (e.g., filtering, reverb) and image processing (e.g., blurring, edge detection).

Convolution takes two signals and combines them to generate a third signal. For 1-D signals, the operation can be thought of as sliding the time-reverse of one signal along the other, and at each time step, taking the integral of the product of the signals (see wikipedia). The convolution operation describes the response of linear time-invariant systems to common input signals. Therefore, it commonly occurs in digital signal processing (DSP) contexts. Audio and image processing are two very common application areas for convolution.

A simple implementation for convolving two discrete time signals requires M*N multiply-add operations, where M and N are the lengths of the two signals. However, by taking advantage of the fact that convolution in the time domain is equivalent to multiplication in the frequency domain, and that transforming between domains can be implemented with O(N*log N) operations, convolution can be sped up. See here for more details.


Related tags

2052 questions
0
votes
1 answer

Regularizing-a-CNN-with-L2-regularization

For CONV2D L2 penalty calculation the code uses p parameter . l2_penalty = l2_lambda * sum([(p**2).sum() for p in conv_layer.parameters()]) What is p variable here exactly and iterates for what ? According to my findings , conv_layer.parameters()…
bullor
  • 1
  • 2
0
votes
1 answer

Cupyx 3D FFT convolution on GPU slows down after multiple sequential calls

First off, I have never asked a question on stackoverflow before, and I will do my best to follow the site guidelines, but let me know if I should changes something about my post. I am attempting to write a function that can quickly extract the pore…
0
votes
2 answers

Performing ndimage.convolve on big numpy.memmap: Unable to allocate 56.0 GiB for an array

While trying to do ndimage.convolve on big numpy.memmap, exception occurs: Exception has occurred: _ArrayMemoryError Unable to allocate 56.0 GiB for an array with shape (3710, 1056, 3838) and data type float32 Seems that convolve creates a regular…
aaxx
  • 55
  • 1
  • 5
0
votes
1 answer

How to do 2D Convolution only at a specific location?

This question has been asked multiple times but still I could not get what I was looking for. Imagine data=np.random.rand(N,N) #shape N x N kernel=np.random.rand(3,3) #shape M x M I know convolution typically means placing the kernel all over the…
deltasata
  • 377
  • 1
  • 4
  • 21
0
votes
0 answers

transposed deformable concolution can be implemented theoretically and easily with pytorch?

In autoencoder structure, when encoder side (deformable conv. layers) and decoder side (transposed deformable(?) conv. layers) are seperated, i want to inform the decoder about the offsets used in the encoder side. Desiring result is for the decoder…
0
votes
0 answers

what is the eigen matrix block packing data structure?

Basically I'm seeking for the data structure of eigen packing of matrix. on eigen convolution eigen packed matrix and after that it perform multiplication. Other optimizer like blas,dnn eigen also used packet convolution but they do something on…
0
votes
1 answer

Sum of Gaussian random variables using python

Given two independent Gaussian variables X and Y, with probability density functions pdf1 and pdf2, then I want to calculate Z = X + Y ~ PDF(Z). The probability density function of Z is given by the convolution of pdf1 and pdf2. I have taken the…
josef12
  • 43
  • 6
0
votes
1 answer

fastest way to calculate edges (derivatives) of a big torch tensor

Given a tensor with shape (b,c,h,w), I want to extract edges of the spatial data, that is, calculate x, y direction derivatives of the (h,w) and calculate the magnitude I=sqrt(|x_amplitude|^2+|y_amplitude|^2) My current implementation is as…
Hadar
  • 658
  • 4
  • 17
0
votes
0 answers

CNN: what if change some convolution layers with others

Generally at the end of CNN there is a linear(fully connected layer) layers. But I have recently thought what if i change some convolution layers in CNN with linear layers? Is it useful? if yes where? or if no why not? I would really like to listen…
0
votes
0 answers

Is there a way of doing a 3-D matrix convolution in Fortran?

I am not so familiar with Fortran, therefore i was wondering if it is possible to convolute two 3-D matrices, either through FFT or direct computation. If it is possible how would one do such a thing in Fortran?
Anand
  • 1
0
votes
1 answer

How to learn a convolution kernel

I have an image matrix A. I want to learn a convolution kernel H that does following operations: A*H gives a tensor "Intermediate" and Intermediate * H gives "A" Here * represents convolution operation (possibly using FFT). I only have the image. I…
d_n2001
  • 1
  • 2
0
votes
1 answer

How do I apply a Gauss Filter in Fourier Space?

I converted a Gauss filter, as well as an image I want to filter, into the fourier space. Are the rules of applying filters in the fourier space the same like in the image space? (e.g. just applying a convolution with np.convolve)?
Severin Spörri
  • 100
  • 1
  • 10
0
votes
1 answer

vectorized way to multiply and add specific axes in numpy array (convolutional layer backprop)

I was wondering how it would be possible to vectorize the following quadruple for-loops (this is t do with backprop in a convolutional layer). W = np.ones((2, 2, 3, 8)) # just a toy example dW = np.zeros(W.shape) dZ = np.ones((10, 4, 4, 8))*2 # get…
0
votes
0 answers

The use of masks in image classification tasks

I am working on an image classification problem and the dataset comes in the following format : class_1_folder : consists of images_folder and mask_folder class_2_folder : consists of images_folder and mask_folder I am quite new to the field and…
0
votes
1 answer

Deconvolution to obtain the unit response

I have measured two signals as time series. One of them is the input of the system and the other one is the output. I assume that if I know the unit response of the system, then I may obtain the output by the convolution of this unit response and…