I have been trying to translate a matlab code for convn(...)
recently and stopped at scipy after I found out about scipy.signal.fftconvolve
As Matlabs convn allows a NxNxD (with D = 100 in my case). It seems that fftconvolve will not perform the same operation for the following code
#kernel is a 5x5 kernel, first expand the kernel to D=100 to match the depth of input array
kernelND = np.repeat(kernel[:,:,np.newaxis], 100, axis=2)
# 'input' is 28x28x100
result = fftconvolve(input, kernelND, mode='valid')
What I get in result is a 24x24x1 value. This is incorrect as I thought of a result 24x24x100 just like matlab.
Any tips towards the error highly appreciate!