示例#1
0
文件: nndescent.py 项目: Giocol/umap
 def init_from_tree(tree, data, query_points, heap, rng_state):
     for i in range(query_points.shape[0]):
         indices = search_flat_tree(
             query_points[i],
             tree.hyperplanes,
             tree.offsets,
             tree.children,
             tree.indices,
             rng_state,
         )
示例#2
0
文件: nndescent.py 项目: wmayner/umap
    def init_from_tree(tree, data, query_points, heap, rng_state):
        for i in range(query_points.shape[0]):
            indices = search_flat_tree(
                query_points[i],
                tree.hyperplanes,
                tree.offsets,
                tree.children,
                tree.indices,
                rng_state,
            )

            for j in range(indices.shape[0]):
                if indices[j] < 0:
                    continue
                d = dist(data[indices[j]], query_points[i], *dist_args)
                heap_push(heap, i, d, indices[j], 1)

        return