{"action":"opened","issue":{"url":"https://api.github.com/repos/BVLC/caffe/issues/2513","labels_url":"https://api.github.com/repos/BVLC/caffe/issues/2513/labels{/name}","comments_url":"https://api.github.com/repos/BVLC/caffe/issues/2513/comments","events_url":"https://api.github.com/repos/BVLC/caffe/issues/2513/events","html_url":"https://github.com/BVLC/caffe/issues/2513","id":81133171,"number":2513,"title":"Caffe CPU convolution","user":{"login":"SuperSoulHunter","id":4675611,"avatar_url":"https://avatars.githubusercontent.com/u/4675611?v=3","gravatar_id":"","url":"https://api.github.com/users/SuperSoulHunter","html_url":"https://github.com/SuperSoulHunter","followers_url":"https://api.github.com/users/SuperSoulHunter/followers","following_url":"https://api.github.com/users/SuperSoulHunter/following{/other_user}","gists_url":"https://api.github.com/users/SuperSoulHunter/gists{/gist_id}","starred_url":"https://api.github.com/users/SuperSoulHunter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuperSoulHunter/subscriptions","organizations_url":"https://api.github.com/users/SuperSoulHunter/orgs","repos_url":"https://api.github.com/users/SuperSoulHunter/repos","events_url":"https://api.github.com/users/SuperSoulHunter/events{/privacy}","received_events_url":"https://api.github.com/users/SuperSoulHunter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-26T20:56:32Z","updated_at":"2015-05-26T20:56:32Z","closed_at":null,"body":"Hi there,\r\n\r\nI'm trying the LeNet example and I modified a few places to understand the inner working of Caffe. It comes to my attention that the CPU convolution layer behaves different from valid conv2 in matlab.\r\n\r\nHere is an example, (I populate the bottom blob with all the 1s) and convolve with the kernel:\r\n\r\nInput Blob:\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\r\n\r\nFilter Weight\r\n -0.038 -0.231 -0.077 0.259 0.079\r\n -0.332 -0.153 0.216 -0.169 -0.019\r\n 0.345 -0.240 -0.023 -0.026 -0.311\r\n 0.106 -0.195 -0.254 0.263 0.081\r\n 0.074 0.257 0.136 -0.287 -0.233\r\n\r\nResult Feature Map:\r\n-0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773 -0.773\r\n\r\n\r\nI'm aware of that there is a biased term to be added after the gemm convolution, however, all the information is printed out immediately after forward_cpu_gemm by a print function added by me in the blob.hpp\r\n\r\nThe results is weird and the correct output should be around 0.5030 (produced by matlab).\r\n\r\nCan anyone kindly explain the inner working of cpu_gemm_conv? Or is it potentially a bug? Thanks."}}