[SYSTEMML-540] Added the documentation for convolution

Closes #464.


Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/1efaa552
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/1efaa552
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/1efaa552

Branch: refs/heads/gh-pages
Commit: 1efaa552063a837ab7bb7f4a7e57e9efb088d7e8
Parents: 4874c4f
Author: Niketan Pansare <[email protected]>
Authored: Sun Apr 30 12:39:12 2017 -0700
Committer: Niketan Pansare <[email protected]>
Committed: Sun Apr 30 12:39:12 2017 -0700

----------------------------------------------------------------------
 dml-language-reference.md                       |  32 +++++++++++++++++++
 img/dml-language-reference/Conv2d.gif           | Bin 0 -> 419930 bytes
 img/dml-language-reference/Conv2d1.gif          | Bin 0 -> 174964 bytes
 .../Conv2d_backward_data.gif                    | Bin 0 -> 444715 bytes
 .../Conv2d_backward_data1.gif                   | Bin 0 -> 427546 bytes
 .../Conv2d_backward_data2.gif                   | Bin 0 -> 376145 bytes
 6 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1efaa552/dml-language-reference.md
----------------------------------------------------------------------
diff --git a/dml-language-reference.md b/dml-language-reference.md
index 31f7d23..9273857 100644
--- a/dml-language-reference.md
+++ b/dml-language-reference.md
@@ -1494,6 +1494,38 @@ The following code snippet shows an example scenario of 
transforming a training
 
 Note that the metadata generated during the training phase (located at 
`/user/ml/train_tf_metadata`) is used to apply the list of transformations 
(that were carried out on training data set) on the test data set. Since the 
second invocation of `transform()` does not really generate any new metadata 
data, the given metadata (`/user/ml/train_tf_metdata`) is copied to the target 
location (`/user/ml/test_tf_metdata`). Even though such a behavior creates 
redundant copies of transformation metadata, it is preferred as it allows the 
association of every data set with the corresponding transformation metadata.
 
+### Deep Learning Built-In Functions
+
+SystemML represent a tensor as a matrix stored in a row-major format,
+where first dimension of tensor and matrix are exactly the same. For example, 
a tensor (with all zeros)
+of shape [3, 2, 4, 5] can be instantiated by following DML statement:
+```sh
+A = matrix(0, rows=3, cols=2*4*5) 
+```
+
+The images are assumed to be stored NCHW format, where N = batch size, C = 
#channels, H = height of image and W = width of image. 
+Hence, the images are internally represented as a matrix with dimension (N, C 
* H * W).
+
+
+| Function name          | Input matrices | Input Parameters                   
                                                                                
                                                                         | 
Notes                                                       |
+|------------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------|
+| conv2d                 | input, filter  | stride=[stride_h, stride_w], 
padding=[pad_h, pad_w], input_shape=[batch_size, num_channels, height_image, 
width_image], filter_shape=[numFilters, numChannels, height_filter, 
width_filter] | Performs 2D convolution operation                           |
+| conv2d_backward_filter | input, dout    | stride=[stride_h, stride_w], 
padding=[pad_h, pad_w], input_shape=[batch_size, num_channels, height_image, 
width_image], filter_shape=[numFilters, numChannels, height_filter, 
width_filter] | Computes the gradients wrt filter of 2D convolution         |
+| conv2d_backward_data   | filter, dout   | stride=[stride_h, stride_w], 
padding=[pad_h, pad_w], input_shape=[batch_size, num_channels, height_image, 
width_image], filter_shape=[numFilters, numChannels, height_filter, 
width_filter] | Computes the gradients wrt input of 2D convolution          |
+| max_pool               | input          | stride=[stride_h, stride_w], 
padding=[pad_h, pad_w], input_shape=[batch_size, num_channels, height_image, 
width_image], pool_size=[height_pool, width_pool]                               
  | Performs max pooling operation                              |
+| max_pool_backward      | input, dout    | stride=[stride_h, stride_w], 
padding=[pad_h, pad_w], input_shape=[batch_size, num_channels, height_image, 
width_image], pool_size=[height_pool, width_pool]                               
  | Computes the gradients wrt input of 2D maxpooling           |
+
+
+Examples:
+
+| Function             | Parameters                  | Visualization           
                                                                                
                                                    |
+|----------------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| conv2d               | stride=[1,1]                | ![conv2d with stride 
1](img/dml-language-reference/Conv2d.gif "conv2d with stride 1")                
                                                       |
+| conv2d               | stride=[2,2]                | ![conv2d with stride 
2](img/dml-language-reference/Conv2d1.gif "conv2d with stride 2")               
                                                       |
+| conv2d_backward_data | stride=[1,1]                | ![conv2d_backward_data 
with stride 1](img/dml-language-reference/Conv2d_backward_data.gif 
"conv2d_backward_data with stride 1")                             |
+| conv2d_backward_data | stride=[2,2]                | ![conv2d_backward_data 
with stride 2](img/dml-language-reference/Conv2d_backward_data1.gif 
"conv2d_backward_data with stride 2")                            |
+| conv2d_backward_data | stride=[2,2] and 2x2 filter | ![conv2d_backward_data 
with stride 2 2x2 filter](img/dml-language-reference/Conv2d_backward_data1.gif 
"conv2d_backward_data with stride 2 with 2x2 filter") |
+
 
 ### Other Built-In Functions
 

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1efaa552/img/dml-language-reference/Conv2d.gif
----------------------------------------------------------------------
diff --git a/img/dml-language-reference/Conv2d.gif 
b/img/dml-language-reference/Conv2d.gif
new file mode 100644
index 0000000..b10a5cf
Binary files /dev/null and b/img/dml-language-reference/Conv2d.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1efaa552/img/dml-language-reference/Conv2d1.gif
----------------------------------------------------------------------
diff --git a/img/dml-language-reference/Conv2d1.gif 
b/img/dml-language-reference/Conv2d1.gif
new file mode 100644
index 0000000..fafc6fa
Binary files /dev/null and b/img/dml-language-reference/Conv2d1.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1efaa552/img/dml-language-reference/Conv2d_backward_data.gif
----------------------------------------------------------------------
diff --git a/img/dml-language-reference/Conv2d_backward_data.gif 
b/img/dml-language-reference/Conv2d_backward_data.gif
new file mode 100644
index 0000000..22c76e3
Binary files /dev/null and 
b/img/dml-language-reference/Conv2d_backward_data.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1efaa552/img/dml-language-reference/Conv2d_backward_data1.gif
----------------------------------------------------------------------
diff --git a/img/dml-language-reference/Conv2d_backward_data1.gif 
b/img/dml-language-reference/Conv2d_backward_data1.gif
new file mode 100644
index 0000000..fccec6a
Binary files /dev/null and 
b/img/dml-language-reference/Conv2d_backward_data1.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1efaa552/img/dml-language-reference/Conv2d_backward_data2.gif
----------------------------------------------------------------------
diff --git a/img/dml-language-reference/Conv2d_backward_data2.gif 
b/img/dml-language-reference/Conv2d_backward_data2.gif
new file mode 100644
index 0000000..f8273c2
Binary files /dev/null and 
b/img/dml-language-reference/Conv2d_backward_data2.gif differ

Reply via email to