mboehm7 commented on code in PR #1904:
URL: https://github.com/apache/systemds/pull/1904#discussion_r1333446178


##########
scripts/builtin/pageRank.dml:
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one

Review Comment:
   add the full license header 



##########
scripts/builtin/pageRank.dml:
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+# DML builtin method for PageRank algorithm
+#
+# INPUT:
+# 
------------------------------------------------------------------------------
+# G           Input Matrix
+# p           Input Vector
+# e           Input Vector
+# u           Input Vector
+# alpha       Input value
+# k           Input value

Review Comment:
   alpha - teleport probability
   k (rename to "max_iter") - maximum number of iterations



##########
src/test/scripts/functions/codegen/SystemDS-config-codegen.xml:
##########
@@ -18,7 +18,7 @@
 -->
 
 <root>
-   <sysds.localtmpdir>/tmp/systemds</sysds.localtmpdir>
+   
<sysds.localtmpdir>C:\Users\slims\Desktop\tmpSystemDS</sysds.localtmpdir><!--/tmp/systemds-->

Review Comment:
   do not hardcode your local paths.



##########
scripts/builtin/pageRank.dml:
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+# DML builtin method for PageRank algorithm
+#
+# INPUT:
+# 
------------------------------------------------------------------------------
+# G           Input Matrix
+# p           Input Vector
+# e           Input Vector
+# u           Input Vector
+# alpha       Input value
+# k           Input value
+# 
------------------------------------------------------------------------------
+#
+# OUTPUT:
+# ---------------------------------------------------------------------------
+# result     Output Matrix
+# ---------------------------------------------------------------------------
+
+pageRank = function (Matrix[Double] G, Matrix[Double] p,
+  Matrix[Double] e, Matrix[Double] u,
+  Double alpha = 0.85, Integer max_iteration = 6)
+  return (Matrix[double] result_matrix)

Review Comment:
   return pprime - computed pagerank (also mention in docs above)



##########
scripts/builtin/pageRank.dml:
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+# DML builtin method for PageRank algorithm
+#
+# INPUT:
+# 
------------------------------------------------------------------------------
+# G           Input Matrix
+# p           Input Vector
+# e           Input Vector
+# u           Input Vector

Review Comment:
   use the following documentation
   
   p initial page rank vector (number of nodes) - if unspecified initialized by 
constant value
   e -> do not expose this parameter - e is an all-ones vector, generated 
inside the function (before the loop)
   ut personalization vector (number of nodes)



##########
scripts/builtin/pageRank.dml:
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+# DML builtin method for PageRank algorithm
+#
+# INPUT:
+# 
------------------------------------------------------------------------------
+# G           Input Matrix
+# p           Input Vector
+# e           Input Vector
+# u           Input Vector
+# alpha       Input value
+# k           Input value
+# 
------------------------------------------------------------------------------
+#
+# OUTPUT:
+# ---------------------------------------------------------------------------
+# result     Output Matrix
+# ---------------------------------------------------------------------------
+
+pageRank = function (Matrix[Double] G, Matrix[Double] p,

Review Comment:
   m_pageRank, which is required by the builtin registration mechanisms (for 
typed overloading) because the first argument is a matrix. The function can 
then be called as pageRank. 



##########
src/main/java/org/apache/sysds/conf/DMLConfig.java:
##########
@@ -148,7 +148,7 @@ public class DMLConfig
        static
        {
                _defaultVals = new HashMap<>();
-               _defaultVals.put(LOCAL_TMP_DIR,          "/tmp/systemds" );
+               _defaultVals.put(LOCAL_TMP_DIR,          
"C:\\Users\\slims\\Desktop\\tmpSystemDS" );// /tmp/systemds

Review Comment:
   do not hard-code your local paths



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@systemds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to