Different 2D convolution results between keras and scipy

后端 未结 2 2004
栀梦
栀梦 2021-01-22 21:04

I found some results difficult to understand when trying to debug my neural network. I tried to do some computations offline using scipy (1.3.0), and I am not havin

2条回答
  •  孤街浪徒
    2021-01-22 21:25

    What is usually called convolution in neural networks (and image processing) is not exactly the mathematical concept of convolution, which is what convolve2d implements, but the similar one of correlation, which is implemented by correlate2d:

    res_scipy = correlate2d(image, kernel.T, mode='same')
    

提交回复
热议问题