code wiki / _hdl_build / nx_vq_train_gate.nx

nx_vq_train_gate.nx

buildroot/runtime/_hdl_build/nx_vq_train_gate.nx

4059 B74 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic vq
docsdependenciesstructsconstsfunctions

about

nx_vq_train_gate.nx -- proves Lloyd's training (nx_vq_train) lowers VQ distortion at the SAME bitrate (better codebook coverage), the bridge from raw VQ toward the neural codebook. Trains a K-entry codebook on T period-varied LPC reflection vectors and measures total distortion before vs after training.

dependencies 5 imports · 0 importers

nx_syscalls_x86_64.nx nx_lpc_autocorr.nx nx_lpc_levinson.nx nx_vq.nx nx_vq_train.nx nx_vq_train_gate.nx

imports: nx_syscalls_x86_64.nxnx_lpc_autocorr.nxnx_lpc_levinson.nxnx_vq.nxnx_vq_train.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main g_puts fill_parabola st16 nx_lpc_autocorr nx_lpc_levinson _q30_mul ld64 vqt_distortion vqt_vec vq_dist2 vq_encode vq_dist2 ↻ vqt_iterate vq_encode ↻ vqt_vec ↻ g_pn g_check g_puts ↻

structs

none

consts

none

functions

10func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: g_checkmain
11func g_pn(v: i64) -> i64
called by 1: main
21func g_check(name: *u8, cond: i64) -> i64
called by 1: main calls 1: g_puts
25func st16(buf: *u8, idx: i64, v: i64) -> i64 { var x: i64 = v; if x < 0 { x = x + 65536 } buf[idx*2] = x & 0xff; buf[idx*2+1] = (x >> 8) & 0xff; return 0 }
called by 1: fill_parabola
26func ld64(buf: *u8, byteoff: i64) -> i64 { var v: i64 = 0; var b: i64 = 0; while b < 8 { v = v | (buf[byteoff + b] << (b*8)); b = b + 1 } return v }
called by 1: main
27func fill_parabola(s: *u8, n: i64, period: i64) -> i64 { var i: i64=0; while i<n { let p: i64 = i % period; st16(s, i, 40 + p*(period-p)*2); i=i+1 } return 0 }
called by 1: main calls 1: st16
29func main() -> i64