Skip to navigation

VamanaIndexParams

View as Markdown

Java package: com.nvidia.cuvs

public class VamanaIndexParams

Supplemental parameters to build a Vamana index.

The defaults match the native cuvs::neighbors::vamana::index_params defaults.

Public Members

supportedGraphDegrees

public static int[] supportedGraphDegrees()

Returns the graph degrees the native Vamana builder supports.

Returns

a copy of the supported graph degrees, in ascending order

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:30

L2Expanded

L2Expanded(0), /** * Euclidean, the square root of

Squared L2.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:45

L2SqrtExpanded

L2SqrtExpanded(1)

Euclidean, the square root of #L2Expanded.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:50

getGraphDegree

public int getGraphDegree()

Gets the maximum degree of the output graph, the R parameter in the Vamana literature.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:97

getVisitedSize

public int getVisitedSize()

Gets the maximum number of visited nodes per search, the L parameter in the Vamana literature.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:105

getVamanaIters

public float getVamanaIters()

Gets the number of Vamana vector insertion iterations.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:112

getAlpha

public float getAlpha()

Gets the alpha pruning parameter.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:119

getMaxFraction

public float getMaxFraction()

Gets the maximum fraction of the dataset inserted per batch.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:126

getBatchBase

public float getBatchBase()

Gets the growth rate base for batch sizes.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:133

getQueueSize

public int getQueueSize()

Gets the candidate queue size.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:140

getReverseBatchSize

public int getReverseBatchSize()

Gets the maximum batch size of reverse edge processing.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:147

getMetric

public CuvsDistanceType getMetric()

Gets the distance metric.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:154

withGraphDegree

public Builder withGraphDegree(int graphDegree)

Sets the maximum degree of the output graph.

Parameters

NameDescription
graphDegreethe graph degree, one of VamanaIndexParams#supportedGraphDegrees()

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:205

withVisitedSize

public Builder withVisitedSize(int visitedSize)

Sets the maximum number of visited nodes per search.

The native builder requires this to be greater than the graph degree.

Parameters

NameDescription
visitedSizethe visited size

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:218

withVamanaIters

public Builder withVamanaIters(float vamanaIters)

Sets the number of Vamana vector insertion iterations.

Parameters

NameDescription
vamanaItersthe iteration count

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:229

withAlpha

public Builder withAlpha(float alpha)

Sets the alpha pruning parameter.

Parameters

NameDescription
alphathe alpha value

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:240

withMaxFraction

public Builder withMaxFraction(float maxFraction)

Sets the maximum fraction of the dataset inserted per batch. A larger batch decreases graph quality but improves build speed.

Parameters

NameDescription
maxFractionthe maximum fraction

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:252

withBatchBase

public Builder withBatchBase(float batchBase)

Sets the growth rate base for batch sizes.

Parameters

NameDescription
batchBasethe batch base

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:263

withQueueSize

public Builder withQueueSize(int queueSize)

Sets the candidate queue size. The native builder expects a value of the form (2^x) - 1.

Parameters

NameDescription
queueSizethe queue size

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:275

withReverseBatchSize

public Builder withReverseBatchSize(int reverseBatchSize)

Sets the maximum batch size of reverse edge processing, which bounds the memory footprint of that stage.

Parameters

NameDescription
reverseBatchSizethe reverse batch size

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:287

withMetric

public Builder withMetric(CuvsDistanceType metric)

Sets the distance metric.

Parameters

NameDescription
metricthe distance metric

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:298

build

public VamanaIndexParams build()

Builds an instance of VamanaIndexParams.

Returns

an instance of VamanaIndexParams

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:308

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndexParams.java:18