You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by ja...@apache.org on 2020/06/04 06:32:04 UTC
[systemml] branch master updated: [DOC] Documentation for builtin
gnmf function
This is an automated email from the ASF dual-hosted git repository.
janardhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/systemml.git
The following commit(s) were added to refs/heads/master by this push:
new 08b95b1 [DOC] Documentation for builtin gnmf function
08b95b1 is described below
commit 08b95b1ca883fb01e22b392cf6c571f248b22e28
Author: Karishma Sinha <3s...@gmail.com>
AuthorDate: Thu Jun 4 11:50:39 2020 +0530
[DOC] Documentation for builtin gnmf function
Example:
```dml
X = rand(rows = 5, cols = 3)
[A, B] = gnmf(X = X, rnk = 2, eps = 10^-8, maxi = 10)
```
Matrix A (Pattern matrix):
0.066 -0.068
0.003 -0.270
0.113 -0.007
0.087 -0.035
0.077 -0.040
Matrix B (Amplitude matrix):
1.043 6.335 7.038
-1.589 -0.115 -0.608
Closes #941.
---
dev/docs/builtins-reference.md | 36 +++++++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/dev/docs/builtins-reference.md b/dev/docs/builtins-reference.md
index cf55a15..51b67e8 100644
--- a/dev/docs/builtins-reference.md
+++ b/dev/docs/builtins-reference.md
@@ -33,6 +33,7 @@ limitations under the License.
* [`steplm`-Function](#steplm-function)
* [`slicefinder`-Function](#slicefinder-function)
* [`normalize`-Function](#normalize-function)
+ * [`gnmf`-Function](#gnmf-function)
* [`toOneHot`-Function](#toOneHOt-function)
@@ -438,9 +439,42 @@ normalize(X);
### Example
```r
X = rand(rows = 50, cols = 10)
-y = X %*% rand(rows=ncol(X), cols=1)
+y = X %*% rand(rows = ncol(X), cols = 1)
y = normalize(X = X)
+```
+
+## `gnmf`-Function
+The `gnmf`-function does Gaussian Non-Negative Matrix Factorization.
+In this, a matrix X is factorized into two matrices W and H, such that all three matrices have no negative elements.
+This non-negativity makes the resulting matrices easier to inspect.
+
+### Usage
+```r
+gnmf(X, rnk, eps = 10^-8, maxi = 10)
+```
+
+### Arguments
+| Name | Type | Default | Description |
+| :------ | :------------- | -------- | :---------- |
+| X | Matrix[Double] | required | Matrix of feature vectors. |
+| rnk | Integer | required | Number of components into which matrix X is to be factored. |
+| eps | Double | `10^-8` | Tolerance |
+| maxi | Integer | `10` | Maximum number of conjugate gradient iterations. |
+
+
+### Returns
+| Type | Description |
+| :------------- | :---------- |
+| Matrix[Double] | List of pattern matrices, one for each repetition. |
+| Matrix[Double] | List of amplitude matrices, one for each repetition. |
+
+### Example
+```r
+X = rand(rows = 50, cols = 10)
+W = rand(rows = nrow(X), cols = 2, min = -0.05, max = 0.05);
+H = rand(rows = 2, cols = ncol(X), min = -0.05, max = 0.05);
+gnmf(X = X, rnk = 2, eps = 10^-8, maxi = 10)
```
## `toOneHot`-Function