API Reference
IVFADCIndex{U<:Unsigned, I<:Unsigned, Dc<:Distances.PreMetric, Dr<:Distances.PreMetric, T<:AbstractFloat, Q<:AbstractCoarseQuantizer{Dc,T}}

The inverse file system object. It allows for approximate nearest neighbor search into the contained vectors.

Fields

  • coarse_quantizer::AbstractCoarseQuantizer{Dc,T} contains the coarse vectors
  • residual_quantizer::QuantizedArrays.OrthogonalQuantizer{U,Dr,T,2}

is employed to quantize vectors when adding to the index

  • inverse_index::InvertedIndex{I,U} is the actual inverse index employed

to perform the search.

source
IVFADC.IVFADCIndex — Method.
IVFADCIndex(data [;kwargs])

Main constructor for building an inverse file system for billion-scale ANN search.

Arguments

  • Matrix{T<:AbstractFloat} input data

Keyword arguments

  • kc::Int=DEFAULT_COARSE_K number of clusters (Voronoi cells) to employ

in the coarse quantization step

  • k::Int=DEFAULT_QUANTIZATION_K number of residual quantization levels to use
  • m::Int=DEFAULT_QUANTIZATION_M number of residual quantizers to use
  • coarse_quantizer::Symbol=DEFAULT_COARSE_QUANTIZER coarse quantizer
  • coarse_distance=DEFAULT_COARSE_DISTANCE coarse quantization distance
  • quantization_distance=DEFAULT_QUANTIZATION_DISTANCE residual quantization distance
  • quantization_method=DEFAULT_QUANTIZATION_METHOD residual quantization method
  • coarse_maxiter=DEFAULT_COARSE_MAXITER number of clustering iterations for obtaining

the coarse vectors

  • quantization_maxiter=DEFAULT_QUANTIZATION_MAXITER number of clustering iterations for

residual quantization

  • index_type=UInt32 type for the indexes of the vectors in the inverted list
source
HNSW.knn_search — Method.
knn_search(ivfadc, point, k[; w=1])

Searches at most k closest neighbors of point in the index ivfadc; the neighbors will be searched for in the points contained in the closest w clusters.

source
delete_from_index!(ivfadc, points)

Deletes the points with indices contained in points from the index ivfadc.

source

Abstract coarse quantizer type. The coarse quantizer is ment to assign a point to a given number of Voronoi cells in which its neighbors will be searched.

source
HNSWQuantizer{U<:Unsigned, V<:Vector{Vector{T}}, D<:Distances.PreMetric, T<:AbstractFloat}

Coarse quantization structure based on HNSW search structure. The hnsw field contains the coarse vectors.

source

Simple alias for Vector{InvertedList{I<:Unsigned, U<:Unsigned}}.

source
InvertedList{I<:Unsigned, U<:Unsigned}

Basic structure which corresponds to the points found within a Voronoi cell. The fields idxs contains the indices of the points while codes contains quantized vector data.

source
NaiveQuantizer{D<:Distances.PreMetric, T<:AbstractFloat}

Coarse quantization structure based on brute force search. The vector fields contains the coarse vectors while distance contains the distance that is used to calculate the distance from a point to the coarse vectors.

source
Base.length — Method.
length(ivfadc::IVFADCIndex)

Returns the number of vectors indexed by ivfadc.

source
Base.pop! — Method.
pop!(ivfadc)

Pops from the index ivfadc the point with the highest index and returns it updating the index as well.

source
Base.popfirst! — Method.
popfirst!(ivfadc)

Pops from the index ivfadc the first point and returns it updating the index as well.

source
Base.push! — Method.
push!(ivfadc, point)

Pushes point to the end of index ivfadc; the point is assigned to a cluster and its quantized code added to the inverted list corresponding to the cluster.

source
Base.pushfirst! — Method.
pushfirst!(ivfadc, point)

Pushes point to the beginning of index ivfadc; the point is assigned to a cluster and its quantized code added to the inverted list corresponding to the cluster.

source
Base.size — Method.
size(ivfadc::IVFADCIndex)

Returns a tuple with the dimensionality and number of the vectors indexed by ivfadc.

source