You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by de...@apache.org on 2016/02/23 19:28:17 UTC

incubator-systemml git commit: Optionally set genRandData4ALS output format

Repository: incubator-systemml
Updated Branches:
  refs/heads/master eca4b46a8 -> 6b6369f79


Optionally set genRandData4ALS output format

Closes #79.


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

Branch: refs/heads/master
Commit: 6b6369f792998a4dbead7310a76fa7e8a36538a1
Parents: eca4b46
Author: Deron Eriksson <de...@us.ibm.com>
Authored: Tue Feb 23 10:26:00 2016 -0800
Committer: Deron Eriksson <de...@us.ibm.com>
Committed: Tue Feb 23 10:26:00 2016 -0800

----------------------------------------------------------------------
 scripts/datagen/genRandData4ALS.dml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6b6369f7/scripts/datagen/genRandData4ALS.dml
----------------------------------------------------------------------
diff --git a/scripts/datagen/genRandData4ALS.dml b/scripts/datagen/genRandData4ALS.dml
index 438442c..eff1ddf 100644
--- a/scripts/datagen/genRandData4ALS.dml
+++ b/scripts/datagen/genRandData4ALS.dml
@@ -27,6 +27,7 @@ n = $cols; # no. of cols of X
 r = $rank; # rank of factorization
 nnz = $nnz; # no. of nonzeros in X
 sigma = ifdef ($sigma, 0.01); # variance of Gaussian noise
+fmt = ifdef ($fmt, "binary"); # output format
 
 # generate original factors by sampling from a normal(0,1.0) distribution
 W = rand(rows = m, cols = r, pdf = "normal", seed = 123);
@@ -38,6 +39,6 @@ X = rand(rows = nnz, cols = 1, pdf = "normal") * sqrt(sigma);
 N = table(I, J, X);
 T = ppred(N, 0, "!=");
 X = T * (W %*% H) + T * N;
-write(X, Xfile, format = "binary");
-write(W, Wfile, format = "binary");
-write(H, Hfile, format = "binary");
+write(X, Xfile, format = fmt);
+write(W, Wfile, format = fmt);
+write(H, Hfile, format = fmt);