Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sparse_quantize with return_index = True #127

Closed
jac99 opened this issue Apr 19, 2020 · 1 comment
Closed

sparse_quantize with return_index = True #127

jac99 opened this issue Apr 19, 2020 · 1 comment
Labels

Comments

@jac99
Copy link

jac99 commented Apr 19, 2020

I'm not sure if this is by design, but currently when sparse_quantize is called with return_index set to True it returns only unique_map (indexes of selected elements). It doesn't return discrete_coords. Which is a bit limiting.

E.g. if I want to quantize my cooardinates and additionally get unique map (to known which points were retained) it's not possible.
I can either get unique discrete coordinates (when calling with return_index=False) or unique_map (when calling with return_index=True).
But knowing unique_map only, I cannot easily compute discrete_coordinates. unique_map tells me which coords are retained (that's my understanding), but I need to apply unique_map index to my real coordinates and quantize them again, to get discrete coords. This is not optimal.

I think it'll be better, if the return_index flag returns unique_map and unique discrete coords. Discrete coords are computed within sparse_quantize, so they can be easily returned.

@chrischoy
Copy link
Contributor

This was due to backward compatibility.

I originally used the quantization function only for returning indices and I agree that it would be more useful to return coordinates again as well.

I'll add this feature to the v0.5 TODO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants