CagraCompressionParams

View as Markdown

Java package: com.nvidia.cuvs

1public class CagraCompressionParams

Supplemental compression parameters to build CAGRA Index.

Public Members

CagraCompressionParams

1private CagraCompressionParams( int pqBits, int pqDim, int vqNCenters, int kmeansNIters, double vqKmeansTrainsetFraction, double pqKmeansTrainsetFraction)

Constructs an instance of CagraCompressionParams with passed search parameters.

Parameters

NameDescription
pqBitsthe bit length of the vector element after compression by PQ
pqDimthe dimensionality of the vector after compression by PQ
vqNCentersthe vector quantization (VQ) codebook size - number of “coarse cluster centers”
kmeansNItersthe number of iterations searching for kmeans centers (both VQ and PQ phases)
vqKmeansTrainsetFractionthe fraction of data to use during iterative kmeans building (VQ phase)
pqKmeansTrainsetFractionthe fraction of data to use during iterative kmeans building (PQ phase)

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:37

getPqBits

1public int getPqBits()

Gets the bit length of the vector element after compression by PQ.

Returns

the bit length of the vector element after compression by PQ.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:57

getPqDim

1public int getPqDim()

Gets the dimensionality of the vector after compression by PQ.

Returns

the dimensionality of the vector after compression by PQ.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:66

getVqNCenters

1public int getVqNCenters()

Gets the vector quantization (VQ) codebook size - number of “coarse cluster centers”.

Returns

the vector quantization (VQ) codebook size - number of “coarse cluster centers”.

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:77

getKmeansNIters

1public int getKmeansNIters()

Gets the number of iterations searching for kmeans centers (both VQ and PQ phases).

Returns

the number of iterations searching for kmeans centers (both VQ and PQ phases).

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:88

getVqKmeansTrainsetFraction

1public double getVqKmeansTrainsetFraction()

Gets the fraction of data to use during iterative kmeans building (VQ phase).

Returns

the fraction of data to use during iterative kmeans building (VQ phase).

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:98

getPqKmeansTrainsetFraction

1public double getPqKmeansTrainsetFraction()

Gets the fraction of data to use during iterative kmeans building (PQ phase).

Returns

the fraction of data to use during iterative kmeans building (PQ phase).

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:108

withPqBits

1public Builder withPqBits(int pqBits)

Sets the bit length of the vector element after compression by PQ.

Possible values: [4, 5, 6, 7, 8]. Hint: the smaller the ‘pq_bits’, the smaller the index size and the better the search performance, but the lower the recall.

Parameters

NameDescription
pqBits

Returns

an instance of Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:153

withPqDim

1public Builder withPqDim(int pqDim)

Sets the dimensionality of the vector after compression by PQ.

When zero, an optimal value is selected using a heuristic.

Parameters

NameDescription
pqDim

Returns

an instance of Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:166

withVqNCenters

1public Builder withVqNCenters(int vqNCenters)

Sets the vector quantization (VQ) codebook size - number of “coarse cluster centers”.

When zero, an optimal value is selected using a heuristic.

Parameters

NameDescription
vqNCenters

Returns

an instance of Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:180

withKmeansNIters

1public Builder withKmeansNIters(int kmeansNIters)

Sets the number of iterations searching for kmeans centers (both VQ and PQ phases).

Parameters

NameDescription
kmeansNIters

Returns

an instance of Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:192

withVqKmeansTrainsetFraction

1public Builder withVqKmeansTrainsetFraction(double vqKmeansTrainsetFraction)

Sets the fraction of data to use during iterative kmeans building (VQ phase).

When zero, an optimal value is selected using a heuristic.

Parameters

NameDescription
vqKmeansTrainsetFraction

Returns

an instance of Builder

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

withPqKmeansTrainsetFraction

1public Builder withPqKmeansTrainsetFraction(double pqKmeansTrainsetFraction)

Sets the fraction of data to use during iterative kmeans building (PQ phase).

When zero, an optimal value is selected using a heuristic.

Parameters

NameDescription
pqKmeansTrainsetFraction

Returns

an instance of Builder

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

build

1public CagraCompressionParams build()

Builds an instance of CagraCompressionParams.

Returns

an instance of CagraCompressionParams

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:228

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraCompressionParams.java:12