Rate This Document
Findability
Accuracy
Completeness
Readability

tree

API Definition

def tree(num_leaves: int, num_leaves_to_search: int, training_sample_size: int, min_partition_size: int, training_iterations: int, spherical: bool, quantize_centroids: bool, random_init: bool, soar_lambda: float, overretrieve_factor: float, distance_measure: string) -> scann.scann_ops.py.scann_builder.ScannBuilder

Function

IVF partitioning configuration (consistent with the open source algorithm).

Parameters

Parameter

Data Type

Description

Value Range

num_leaves

int

Total subspace number in the IVF partition.

≥ 1

num_leaves_to_search

int

Default number of subspaces to be searched.

[1, num_leaves], where num_leaves indicates the total number of subspaces in the IVF index partition.

training_sample_size

int

Number of samples in the base library during partitioned training.

[0, number_of_base_libraries]

min_partition_size

int

Number of base library vectors contained in the smallest partition.

[0, number_of_base_libraries]

training_iterations

int

Number of training iterations.

≥ 1

spherical

Boolean

Indicates whether the partition type is spherical.

-

quantize_centroids

Boolean

Indicates whether to quantize the bucket center.

-

random_init

Boolean

Indicates whether to start training randomly.

-

soar_lambda

float

Controls orthogonality. This parameter takes effect only for the IP (dot_product) dataset.

> 0. If the value is to -1, the function is disabled.

overretrieve_factor

float

Used together with soar_lambda to specify the over-retrieval factor. This parameter takes effect only for the IP (dot_product) dataset.

[1, 2]. If the value is to -1, the function is disabled.

distance_measure

Character string

Distance type of the vector.

dot_product or squared_l2.

Return Value

Data Type

Description

scann.scann_ops.py.scann_builder.ScannBuilder

ScannBuilder is used to receive build parameters.