Github user aray commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16483#discussion_r106546448
  
    --- Diff: graphx/src/main/scala/org/apache/spark/graphx/lib/PageRank.scala 
---
    @@ -322,13 +335,12 @@ object PageRank extends Logging {
         def personalizedVertexProgram(id: VertexId, attr: (Double, Double),
           msgSum: Double): (Double, Double) = {
           val (oldPR, lastDelta) = attr
    -      var teleport = oldPR
    -      val delta = if (src==id) resetProb else 0.0
    -      teleport = oldPR*delta
    -
    -      val newPR = teleport + (1.0 - resetProb) * msgSum
    -      val newDelta = if (lastDelta == Double.NegativeInfinity) newPR else 
newPR - oldPR
    -      (newPR, newDelta)
    +      val newPR = if (lastDelta == Double.NegativeInfinity) {
    --- End diff --
    
    I'm guessing you mean the `if (src==id)` check? I'm honestly not sure what 
was going on with this code its just wrong. The results do not match up with 
igraph/networkx at all. Furthermore the code is just nonsensical -- definition 
of `var teleport = oldPR` that is then unconditionally set two lines down to  
`teleport = oldPR*delta` without being used prior.
    
    This revised implementation is much easier to follow and is now tested 
against 3 sets of reference values computed by igraph/networkx. Please let me 
know if you thing I'm missing something.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to