code wiki / (root) / nx_text2motion.nx

nx_text2motion.nx

buildroot/runtime/nx_text2motion.nx

7764 B165 linesdepth 6pulls 7 transitivereach 4 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_text2motion.nx -- TEXT-CONDITIONED neural motion (the MotionGPT headline, S6b): a description -> motion, via LEARNED weights, no keyword if-else. Two learned stages, sovereign + integer-deterministic: (1) TEXT ENCODER: bag-of-words over a small vocab -> a linear classifier (weight matrix W[class][word]) TRAINED by the perceptron rule (error-driven weight updates) on (caption -> move-class) pairs. This is real supervised learning; the honest test is GENERALIZATION to captions never trained on (held-out). (2) CLASS-CONDITIONED generator: per class, a token-transition model learned from that class's motion tokens (composes with nx_motion_neural's VQ codebook), so text -> class -> a generated motion-token sequence. The chain: caption -> t2m_encode (learned argmax) -> class -> t2m_gen_tokens (learned transitions) -> decode via the VQ codebook -> drive the rig. Fixed vocab + fixed classes = data; grow by adding captions/moves. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_motion_neural.nx nx_text2motion.nx nx_synth_serve.nx nx_text2motion_gate.nx

imports: nx_syscalls.nxnx_motion_neural.nx

imported by: nx_synth_serve.nxnx_text2motion_gate.nx

structs

none

consts

14const T2M_VOCAB: i64 = 32 // known word slots
15const T2M_CLASSES: i64 = 10 // = MN_MOVES (wave/cheer/sway/kick/lookaround/armcircle/clap/punch/bow/jumpingjack)

functions

20func t2m_word_id(w: *u8, off: i64, len: i64) -> i64
called by 1: t2m_bow calls 1: t2m_weq
55func t2m_weq(w: *u8, off: i64, len: i64, s: *u8) -> i64
called by 1: t2m_word_id
63func t2m_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c }
called by 1: t2m_bow
65func t2m_bow(cap: *u8, bow: *i64) -> i64
96func t2m_score(W: *i64, c: i64, bow: *i64) -> i64
called by 1: t2m_predict
102func t2m_predict(W: *i64, bow: *i64) -> i64
called by 2: t2m_traint2m_encode calls 1: t2m_score
116func t2m_train(W: *i64, cap_ptr: *i64, labels: *i64, ncap: i64, epochs: i64) -> i64
146func t2m_encode(W: *i64, cap: *u8) -> i64
154func t2m_class_bigram(tokens: *i64, cls: i64, trans_c: *i64) -> i64