Normalized Vector by connortsui20 · Pull Request #7251 · vortex-data/vortex
Summary
Continuation of #7107.
Since we want to add a bunch of new vector encodings that rely on unit normalization (spherical transform, turboquant), we would like to introduce this as an encoding.
Note that once we eventually have #6717, the operations will be a lot less ugly.
Also, we can only do the broadcasting trick with RunEnd and Sequence array multiplication on the decompress side, we can't do it on the compress side because we may potentially divide by 0 (and we can't intercept that and say return 0 in that case).
There is an open question on if, instead of representing this as a physical encoding, we should have scalar encodings like this one (others include FoR and ZigZag) be scalar functions. Whatever we decide, we should probably just merge this first as we can always change this later.
Open Questions
- Do we want a helper function for creating a new expression and applying it to an array?
API Changes
Adds a new vector encoding to the vortex-tensor crate.
Testing
Basic tests.