yahoo / lopq

Training of Locally Optimized Product Quantization (LOPQ) models for approximate nearest neighbor search of high dimensional data in Python and Spark.
Apache License 2.0
562 stars 130 forks source link

where is the API which can change the value of w according to the paper? #19

Open FartFang opened 6 years ago

FartFang commented 6 years ago

Thanks a lot for implement! Where is the API which can change the value of w according to the paper in python implement(not spark)? And what is the default value of w in your implement? Looking forward for your reply!

pumpikano commented 6 years ago

The parameter w from the paper is the number of coarse quantizer cells to retrieve for a query before reranking. This implementation instead uses the concept of a result "quota" — it will retrieve as many cells as needed to meet a result quota before reranking. If you want to specify a fixed number of cells, you will need to implement this yourself. See the search code for the current quota-based implementation: https://github.com/yahoo/lopq/blob/master/python/lopq/search.py#L101-L125