code wiki / _hdl_build / nx_vec_embed.nx
nx_vec_embed.nx
buildroot/runtime/_hdl_build/nx_vec_embed.nx
about
nx_vec_embed.nx -- R-VEC-1 of the onsite-search S-class ladder: SOVEREIGN text->vector embeddings (LIBRARY),
the CLASSICAL (count-based distributional) kind -- "methods to generate this mapping include neural networks"
(cited srch_embedding.raw); this is the pre-neural, fully-sovereign, no-external-weights path (ladder option A).
Principle (distributional semantics, cited srch_word2vec.raw): words in SIMILAR CONTEXTS get SIMILAR vectors.
Realized with zero ML training instability: a term x term co-occurrence matrix from the corpus; each term's
vector is its co-occurrence row; a query/doc is the bag-sum of its term vectors; relatedness = cosine
(R-VEC-0 kernel). KAT lives in nx_vec_embed_gate.nx (library+gate split, matching nx_vec_kernel/nx_vec_fuse).
HONEST: count-based, NOT neural understanding -- the neural cross-encoder stays census-BEHIND (R-VEC-6).
Production scale = fill the matrix from the real manifest + reduce dims (R-VEC-4 quantization) -- wiring, not math.
exports: vr_embed (term->vec), ve_docvec (bag->vec), ve_build_co. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_vec_embed_gate.nxnx_vec_hybrid_gate.nx
structs
| none |
consts
| 15 | const VE_V: i64 = 17 // controlled-corpus vocab size (gate); production reads vocab from the index |
functions
| 18 | func ve_build_co(M: *i64, sent: *i64, L: i64) -> i64 |
| 32 | func vr_embed(M: *i64, t: i64) -> *i64 { return ((M as i64) + t*VE_V*8) as *i64 } |
| 35 | func ve_docvec(M: *i64, terms: *i64, nt: i64, out: *i64) -> i64 |