Skip to content

zero padding not working in convolve2_nn [BUG] #315

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

Closed
MichaelMcCulloch opened this issue Feb 14, 2022 · 2 comments · Fixed by #316
Closed

zero padding not working in convolve2_nn [BUG] #315

MichaelMcCulloch opened this issue Feb 14, 2022 · 2 comments · Fixed by #316
Assignees
Labels

Comments

@MichaelMcCulloch
Copy link
Contributor

Description

  • Details regarding the bug
    • Zero Padding not allowed by Convolve2_nn
  • Did you build ArrayFire yourself or did you use the official installers
    • Official Installers
  • Which backend is experiencing this issue? (CPU, CUDA, OpenCL)
    • all of them
  • Do you have a workaround?
    • No
  • Can the bug be reproduced reliably on your system?
    • Yes
  • A clear and concise description of what you expected to happen.
  • Run your executable with AF_TRACE=all and AF_PRINT_ERRORS=1 environment
    variables set.
  • Screenshot or terminal output of the results from above run

screenshot of failure

Reproducible Code and/or Steps

#[test]
    fn mnist__convolutional_neural_net__learns_mnist_fail() {
        let signal = randu::<f32>(dim4!(8, 8, 3, 1));

        let quadrant1 = Array::new(&vec![1f32, 0.0, 0.0, 0.0], dim4![2, 2, 1, 1]);

        let q1 = convolve2_nn(
            &signal,
            &quadrant1,
            dim4!(2, 2, 1, 1),
            dim4!(0, 0, 1, 1),
            dim4!(1, 1, 1, 1),
        );

        af_print!("q1", q1);
    }

System Information

Please provide the following information:

  1. ArrayFire version
    • 3.8
  2. Devices installed on the system
    *. RTX 3090, R9 5950X
  3. (optional) Output from the af::info() function if applicable.

ArrayFire v3.8.1 (CUDA, 64-bit Linux, build default)
Platform: CUDA Runtime 11.5, Driver: 510.47.03
[0] NVIDIA GeForce RTX 3090, 24252 MB, CUDA Compute 8.6
test tests::info____ ... ok

  1. Output from the following scripts:

LSB Version: n/a
Distributor ID: ManjaroLinux
Description: Manjaro Linux
Release: 21.2.3
Codename: Qonos

name, memory.total [MiB], driver_version
NVIDIA GeForce RTX 3090, 24576 MiB, 510.47.03

Checklist

  • [Y] Using the latest available ArrayFire release
  • [Y] GPU drivers are up to date
@syurkevi syurkevi changed the title [BUG] zero padding not working in convolve2_nn [BUG] Feb 14, 2022
@syurkevi
Copy link

For devs reference, issue is on this line:

padding.ndims() as c_uint,

and the corresponding line for the gradient function as well.
ndims() will return 0 for 0 padding when it should pass a "2" (or matching signal.ndims() ) instead

@syurkevi syurkevi assigned syurkevi and unassigned syurkevi Feb 14, 2022
@9prady9 9prady9 self-assigned this Feb 17, 2022
@9prady9
Copy link
Member

9prady9 commented Feb 19, 2022

I am contemplating if I should avoid using dim4 for padding arguments all together. I am looking into it, will send in a fix soon. Thank you for reporting it @MichaelMcCulloch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants