Comments (6)
Hi Juho,
I get your point, but it seems like a custom solution, which will require additional efforts as there is no such option in the original nanoflann library, so I have no plans for this now. Contributions are welcome.
from pynanoflann.
Do you need kd_trees
after queries? Or would such an interface work too?
import pynanoflann
import numpy as np
n_batches = 10
target = np.random.rand(n_batches, 10000, 3)
query = np.random.rand(n_batches, 2000, 3)
distances, nn_indexes = batched_search(target, query, n_neighbors=1, metric='L2', leaf_size=20)
from pynanoflann.
Hey Dmitrii,
Thanks for the very fast response.
In my current application I don't need the trees so they can be thrown away.
from pynanoflann.
I added Parallelized batch processing.
pip install git+https://github.com/u1234x1234/[email protected]
Full example:
https://github.com/u1234x1234/pynanoflann/blob/master/tests/test_batched_kneighbors.py
Internally it works for the list of numpy arrays of arbitrary shapes ie:
target = [
np.random.rand(10000, 3),
np.random.rand(5000, 3),
np.random.rand(40000, 3),
]
I've implemented a more general interface at the cost of small overhead.
from pynanoflann.
Hey,
I tested the implementation and it works very well. No bugs found. And have to say the library is now very fast with these multicore capabilities. As far as I know this is the fastest kd-tree implementation for python.
This helped me a lot and made my algorithm many times faster. Thank you very much.
from pynanoflann.
I'm glad it helped you.
from pynanoflann.
Related Issues (9)
- Serializing KDTrees HOT 5
- How to find the package 'nanoflann_ext' ? HOT 2
- Adding pynanoflann to pypi HOT 1
- Memory leak HOT 3
- Multicore processing of query points HOT 6
- What does the radius parameter do? HOT 7
- Parallelized Radius Query HOT 6
- how can i added quad_tree nearest method in benchmark? HOT 3
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 pynanoflann.