pub struct Coded {
pub norm: f32,
pub scale: f32,
pub lo: f32,
pub delta: f32,
}Expand description
What a code needs alongside it to be measured against a query.
lo and delta are only worth storing for Bits::Four. At one bit they
are the same two numbers for every vector in the collection, so a store that
keeps them per vector is keeping the dimension eight bytes at a time.
Fields§
§norm: f32The length of the vector minus its centroid.
scale: f32One over the cosine between the vector and what its code reconstructs to. That cosine is the estimator’s correction and the whole of RaBitQ over plain binary quantisation.
Stored the wrong way up on purpose, because the estimator divides by it exactly once per member and a float division was 44 percent of what a member cost: 3.56 nanoseconds became 1.98 at 128 dimensions when the division became a multiplication. Nothing else here reads it, so nothing else pays for the inversion.
lo: f32The value level zero reconstructs to, over the length of the reconstruction.
delta: f32What one level is worth, over the length of the reconstruction.