Comments (1)
Hi, thank you for your interest!
For your issue, MAX_BLOCK_NUM is used to control the maximum number of data points in a block. Please refer to lines 44-47 of h2_alsh.cc. By default. I set it to 5,000, considering that the commonly used datasets comprise millions of points.
If you tune it down to 1,000, the number of blocks will increase, and hence the indexing time and index size might increase as we have to build more index (i.e., qalsh) for more blocks. However, the query time might also decrease as you might check fewer points in the first few blocks and stop early if some suitable answers can be found.
Nevertheless, you might not want to keep decreasing MAX_BLOCK_NUM because the index can only offer a little acceleration (as the number of points in a block is small) if the algorithm does not stop early. In the worst case, it will be reduced to an exhaustive linear scan of the data points from the largest to the smallest norm.
My suggestion is that you can (1) extract a small fraction of the data points (e.g., 100 or 200) with the largest norms and (2) directly scan all of them for every query to increase the chance of early termination (and achieve a good candidate with a large inner product value for pruning). Then, tune MAX_BLOCK_NUM (via grid search) to make a trade-off between indexing overhead and query efficiency. For example, some experienced values of MAX_BLOCK_NUM are n/200~n/50.
from h2_alsh.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h2_alsh.