Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
msluszniak committed Mar 26, 2024
1 parent d8ea3bd commit 0cbcc00
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/scholar/neighbors/random_projection_forest.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ defmodule Scholar.Neighbors.RandomProjectionForest do
In this implementation the trees are complete, i.e. there are 2^l nodes at level l.
The leaves of the trees are arranged as blocks in the field `indices`. We use the same
hyperplane for all nodes on the same level as in [2].
* [1] - Randomized partition trees for nearest neighbor search
* [2] - Fast Nearest Neighbor Search through Sparse Random Projections and Voting
"""
Expand Down Expand Up @@ -277,7 +278,9 @@ defmodule Scholar.Neighbors.RandomProjectionForest do
@doc """
Computes approximate nearest neighbors of query tensor using random projection forest.
Returns the neighbor indices and distances from query points.
## Examples
iex> key = Nx.Random.key(12)
iex> tensor = Nx.iota({5, 2})
iex> forest = Scholar.Neighbors.RandomProjectionForest.fit(tensor, num_neighbors: 2, num_trees: 3, key: key)
Expand Down

0 comments on commit 0cbcc00

Please sign in to comment.