code wiki / _hdl_build / nx_vq_train_gate.nx

nx_vq_train_gate.nx

buildroot/runtime/_hdl_build/nx_vq_train_gate.nx

4501 B82 linesdepth 4pulls 8 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 6 imports · 0 importers

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

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

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

11func 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 }
12func g_pn(v: i64) -> i64
22func g_check(name: *u8, cond: i64) -> i64
26func 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 }
27func 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 }
28func 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 }
30func main() -> i64