I'm trying to convolve a 3 dimensional values array of shape (10, 100, 100) with a gaussian of shape (10, 100, 100). When I use the convolve function I get a Value error.
def gaussian(x, mu, sigma):
g = (1./ (sigma * sqrt(2*pi))) * exp(-(x - mu)**2 / sigma**2)
return g
gauss_I = gaussian( values, mean(values), std(values) )
import numpy as np
np.convolve( values, gauss_I)
convolve(values, gauss_I)
Traceback (most recent call last):
File "", line 1, in convolve(values, gauss_I)
File "/Users/Me/Applications/anaconda/lib/python3.5/site-packages/numpy/core/numeric.py", line 1013, in convolve
return multiarray.correlate(a, v[::-1], mode)
ValueError: object too deep for desired array
I've also used the correlate function but that gives me the same error.


np.convolvesay:convolution of two one-dimensional sequences.convolvecallscore.multiarray.correlateright away, and that isbuilt-in(i.e. compiled). This is a usage error - wrong dimensions for the inputs.