Options to build ScaNN.
tflite_model_maker.searcher.ScaNNOptions(
distance_measure: str,
tree: Optional[tflite_model_maker.searcher.Tree
] = None,
score_ah: Optional[tflite_model_maker.searcher.ScoreAH
] = None,
score_brute_force: Optional[tflite_model_maker.searcher.ScoreBruteForce
] = None
)
Used in the notebooks
ScaNN
(https://ai.googleblog.com/2020/07/announcing-scann-efficient-vector.html) is
a highly efficient and scalable vector nearest neighbor retrieval
library from Google Research. We use ScaNN to build the on-device search
index, and do on-device retrieval with a simplified implementation.
Attributes |
distance_measure
|
How to compute the distance. Allowed values are
'dot_product' and 'squared_l2'. Please note that when distance is
'dot_product', we actually compute the negative dot product between query
and database vectors, to preserve the notion that "smaller is closer".
|
tree
|
Configure partitioning. If not set, no partitioning is performed.
|
score_ah
|
Configure asymmetric hashing. Must defined this or
score_brute_force .
|
score_brute_force
|
Configure bruce force. Must defined this or score_ah .
|
Methods
__eq__
__eq__(
other
)
Class Variables |
score_ah
|
None
|
score_brute_force
|
None
|
tree
|
None
|