Hi Janardhan, The error is due to incorrect usage of the builtin function. The first parameter should be the filter matrix and second parameter should be the error matrix from the next layer. Note: the error matrix will be same size as the input matrix only in case of same padding. From https://stackoverflow.com/questions/37674306/what-is-the-difference-between-same-and-valid-padding-in-tf-nn-max-pool-of-t :
For the SAME padding, the output height and width are computed as: out_height = ceil(float(in_height) / float(strides[1])) out_width = ceil(float(in_width) / float(strides[2])) And For the VALID padding, the output height and width are computed as: out_height = ceil(float(in_height - filter_height + 1) / float(strides[1])) out_width = ceil(float(in_width - filter_width + 1) / float(strides[2])) I would also recommend checking out our nn library ( https://github.com/apache/systemml/blob/master/scripts/nn/layers/conv2d_builtin.dml#L127 ) and DML documentation ( http://apache.github.io/systemml/dml-language-reference.html#deep-learning-built-in-functions ). Thanks, Niketan Pansare IBM Almaden Research Center E-mail: npansar At us.ibm.com http://researcher.watson.ibm.com/researcher/view.php?person=us-npansar From: Janardhan <[email protected]> To: [email protected] Date: 07/18/2018 07:16 AM Subject: `conv2d_backward_data()` received "Incorrect dimensions" error. Thanks Hi, I used the following code same as found in reference. I am receiving error as ` Incorrect dimensions in DnnOp: 25 != 9` C = 1; H = 5; W = 5 input = matrix(seq(1, C*H*W), rows=1, cols=C*H*W) filter = matrix(seq(1, C*3*3), rows=1, cols=C*3*3) output = conv2d_backward_data(input, filter, stride=[1,1], padding=[1,1], input_shape=[1,C,H,W], filter_shape=[1,C,3,3]) print(toString(matrix(output, rows=5, cols=5))) I do not fully know about this function works, please accept sorry if the report is incorrect. Thank you, Janardhan
