flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danielblazevski <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-1745] Add exact k-nearest-neighbours al...
Date Wed, 28 Oct 2015 18:29:23 GMT
Github user danielblazevski commented on the pull request:

    @tillrohrmann I now have more time to go back and try to finalize this PR in the next
couple of weeks.  After debugging a bit, I noticed that in your modification of `partitionBox`,
the variable `center` is different before and after the call of `partitionBox` in `makeChildren`.
 For example, in `makeChildren` I added some lines to print to the console, namely
    ``` scala
         println("center before partitioning =  " + center)
          val cPart = partitionBox(center, width)
          println("cPart =  " + cPart)
          val mappedWidth = 0.5*width.asBreeze
          children = cPart.map(p => new Node(p, mappedWidth.fromBreeze, null))
          println("center after partitioning =  " + center)
    The output to console is
    center before partitioning =  DenseVector(0.0, 0.0)
    cPart =  List(DenseVector(-0.5, -0.25), DenseVector(-0.5, 0.25), DenseVector(0.5, -0.25),
DenseVector(0.5, 0.25))
    center after partitioning =  DenseVector(0.5, 0.25)
    So the output `cPart` looks good, but the value of `center` after partitioning should
still be `(0.0,0.0)`.  I'm confused as to how it is even changed to `(0.5, 0.25)` the final
entry of `cPart`, and hence not clear how to fix that.  I imagine it should be an easy fix;
of course I can use a hack to update `center` to be the average of `cPart`, but that seems
wasteful since `center`for a given node should not be changed.

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 infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message