tflite_model_maker.searcher.ScaNNOptions

Options to build ScaNN.

Used in the notebooks

Used in the tutorials

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.

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__

score_ah None
score_brute_force None
tree None