nx_rvq.nx
buildroot/runtime/nx_rvq.nx
about
nx_rvq.nx -- RESIDUAL VECTOR QUANTIZATION, moonshot rung #3 and the literal structure inside SoundStream / Lyra-v2 /
Encodec: a stack of S codebooks where stage k quantises the RESIDUAL left by stages 0..k-1. Reconstruction is the sum
of the chosen stage centroids; each added stage costs log2(K) bits and shrinks the residual -> a rate-distortion knob.
The neural codec replaces these fixed centroids with learned ones over a learned latent; the structure is identical.
Composes nx_vq (+ nx_vq_train trains each stage on its residuals). license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_vq.nx
imported by: nx_rvq_gate.nx
structs
| none |
consts
| none |
functions
| 9 | func rvq_stage(cbs: *i64, k: i64, K: i64, D: i64) -> *i64 { return (cbs as i64 + k*K*D*8) as *i64 } |
| 12 | func rvq_encode(v: *i64, D: i64, cbs: *i64, K: i64, S: i64, indices: *i64, resid: *i64) -> i64 |
| 27 | func rvq_decode_partial(indices: *i64, cbs: *i64, K: i64, D: i64, stages: i64, out: *i64) -> i64 |
| 41 | func rvq_dist(v: *i64, out: *i64, D: i64) -> i64 called by 1: main |