You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by ni...@apache.org on 2017/04/30 19:40:53 UTC

incubator-systemml git commit: [SYSTEMML-540] Added the documentation for convolution

Repository: incubator-systemml
Updated Branches:
  refs/heads/master 738ddfc17 -> b50fe1078


[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/b50fe107
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/b50fe107
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/b50fe107

Branch: refs/heads/master
Commit: b50fe1078a3ad2e4f3ae50560ba5dfd269059b5f
Parents: 738ddfc
Author: Niketan Pansare <np...@us.ibm.com>
Authored: Sun Apr 30 12:39:12 2017 -0700
Committer: Niketan Pansare <np...@us.ibm.com>
Committed: Sun Apr 30 12:39:12 2017 -0700

----------------------------------------------------------------------
 docs/dml-language-reference.md                  |  32 +++++++++++++++++++
 docs/img/dml-language-reference/Conv2d.gif      | Bin 0 -> 419930 bytes
 docs/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/b50fe107/docs/dml-language-reference.md
----------------------------------------------------------------------
diff --git a/docs/dml-language-reference.md b/docs/dml-language-reference.md
index 31f7d23..9273857 100644
--- a/docs/dml-language-reference.md
+++ b/docs/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/b50fe107/docs/img/dml-language-reference/Conv2d.gif
----------------------------------------------------------------------
diff --git a/docs/img/dml-language-reference/Conv2d.gif b/docs/img/dml-language-reference/Conv2d.gif
new file mode 100644
index 0000000..b10a5cf
Binary files /dev/null and b/docs/img/dml-language-reference/Conv2d.gif differ

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

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

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

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