code wiki / (root) / nx_motion_neural.nx

nx_motion_neural.nx

buildroot/runtime/nx_motion_neural.nx

7364 B186 linesdepth 5pulls 6 transitivereach 6 importersview sourcekind librarytopic motion
docsdependenciesstructsconstsfunctions

about

nx_motion_neural.nx -- the NEURAL-MOTION FOUNDATION (S6, MotionGPT/T2M-GPT thesis "motion as language", sovereign + no 491MB LLM load): a motion is discretized into TOKENS by a codebook LEARNED from data (vector quantization = k-means, the exact VQ-VAE quantizer), and a learned token-TRANSITION model GENERATES novel motion-token sequences. This is real learning-from-data (not the parametric keyword->recipe of nx_movelib): the codebook is trained (Lloyd iterations reduce distortion) and the generator composes sequences it was never given whole. Integer fx (rad4096 joint angles) => deterministic, VM-vettable. The token-LM here is an n-gram (the bootstrap); the transformer/our-Qwen over these tokens is the deeper rung. license_tier: ORIGINAL

dependencies 2 imports · 4 importers

nx_syscalls.nx nx_movelib.nx nx_motion_neural.nx nx_motion_neural_gate.nx nx_synth_serve.nx nx_text2motion.nx nx_text2motion_gate.nx

imports: nx_syscalls.nxnx_movelib.nx

imported by: nx_motion_neural_gate.nxnx_synth_serve.nxnx_text2motion.nxnx_text2motion_gate.nx

structs

none

consts

10const MN_MAGIC_1103515245: i64 = 1103515245
11const MN_MAGIC_12345: i64 = 12345
13const MN_D: i64 = 7 // pose vector dims (the joints the move vocabulary drives)
14const MN_FR: i64 = 16 // frames sampled per move (over one stride)
15const MN_MOVES: i64 = 10 // wave/cheer/sway/kick/lookaround/armcircle/clap/punch/bow/jumpingjack
16const MN_N: i64 = 160 // corpus rows = MN_MOVES * MN_FR
17const MN_K: i64 = 16 // codebook size (bumped for the richer 10-move pose space)

functions

21func pose_read(sk: i64, out: *i64) -> i64
called by 1: mn_build_corpus calls 1: sk_bone
32func pose_apply(sk: i64, v: *i64) -> i64
called by 3: mainsv_do_text2motionmain calls 1: sk_pose
44func mn_build_corpus(sk: i64, corpus: *i64) -> i64
68func mn_dist(a: *i64, ao: i64, b: *i64, bo: i64) -> i64
75func mn_encode(src: *i64, so: i64, cb: *i64) -> i64
87func mn_distortion(corpus: *i64, cb: *i64) -> i64
called by 2: mn_trainmain calls 2: mn_encodemn_dist
98func mn_init_cb(corpus: *i64, cb: *i64) -> i64
109func mn_train(corpus: *i64, cb: *i64, iters: i64) -> i64
139func mn_tokenize(corpus: *i64, cb: *i64, tokens: *i64) -> i64
called by 3: mainsv_do_text2motionmain calls 1: mn_encode
145func mn_bigram(tokens: *i64, trans: *i64) -> i64
called by 1: main
161func mn_lcg(st: *i64) -> i64 { st[0] = (st[0] * MN_MAGIC_1103515245 + MN_MAGIC_12345) & 0x7fffffff; return st[0] }
called by 1: mn_generate
163func mn_generate(trans: *i64, seed: i64, st: *i64, out: *i64, len: i64) -> i64
called by 3: mainsv_do_text2motionmain calls 1: mn_lcg