-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
padding support for dnn_conv #2259
Conversation
+1 for adding this functionality, but the interface should probably be different. In #2118, we more or less agreed on using I'd suggest to use the |
@@ -459,7 +473,7 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1), | |||
|
|||
:param img: images to do the convolution over | |||
:param kerns: convolution filters | |||
:param border_mode: one of 'valid', 'full' (default: 'valid') | |||
:param border_mode: one of 'valid', 'full' or 'padding'(default: 'valid') | |||
:param subsample: perform subsampling of the output (default: (1, 1)) | |||
:param conv_mode: perform convolution (kernels flipped) or cross-correlation. One of 'conv', 'cross'. (default: 'conv') | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring for padding
is missing. But I'd suggest to merge the parameter with border_mode
anyway, and add the corresponding documentation to it.
@f0k Thanks for your suggestion :) I added a new commit jia-kai@291f8c1 . Should I issue another pull request ? |
When you push to your repo on github a new commit to a branch that you used for a PR, the PR is updated. Told otherwise, the PR is a branch and the most up to date version of that branch, not a commit. So no need for a new PR. thanks |
The PR seem good, but it need tests. Can you add them in the file sandbox/cuda/tests/test_conv_cuda_ndarray.py? |
@nouiz Thanks for your information:) I've added the test cases. BTW, all test_gemm tests fail with a message like the following, which I guess is due to that cuDNN is preferred over gemm:
|
For the error, thanks for tell it. To prevent conflict, can you add the fix to your PR?
|
@nouiz I added tests for GpuCorrMM. There are still 3 failed tests: 2 of them seem to be caused by precision loss:
the other is test_default_conv, it still uses cuDNN, although 'local_gpu_conv' and 'local_conv_gemm' have been excluded; I've also checked my theanorc and env to make sure cudnn is not enabled explicitly:
|
This seems like a lot. But judging from the relative differences, the numbers are just very large. Which test is it? And shouldn't it run through because the relative differences are all smaller than the rtol of 1.1e-05?
Since a few weeks, cuDNN is not opt-in anymore, but opt-out. For By the way, thanks for fixing the tests! |
thanks. |
I'm running the tests here. The example you gave seem just that the test is On Tue, Nov 18, 2014 at 4:23 AM, Jan Schlüter notifications@github.com
|
cudnn supports padding and I exported this functionality by adding a new param padding to dnn_conv; to enable padding, border_mode must be set to 'padding'.