code wiki / _hdl_build / nx_skinfam_train_gate.nx
nx_skinfam_train_gate.nx
buildroot/runtime/_hdl_build/nx_skinfam_train_gate.nx
about
nx_skinfam_train_gate.nx -- ★★P4 NEURAL RUNG 2: a GENERATIVE sovereign skin-texture FAMILY. R1 proved
exemplar-fit; R2 proves GENERATION: an AUTO-DECODER (DeepSDF/GLO-style) coordinate-MLP with a LEARNED 8-dim
LATENT per training patch, trained jointly on SIX real skin patches (Elara exemplar) by the R1 integer
machinery (Q12 backprop + error-feedback + frequency-scaled init). After training, NEW latents (interpolations
+ in-range draws) generate NOVEL skin textures that never existed = seed -> novel skin, the persongen
philosophy carried into the neural track.
T1 joint training CONVERGES (err < half of untrained across all 6 patches)
T2 per-patch reconstructions are FAITHFUL (avg err < 22/255) and DISTINCT (the latent separates patches)
T3 ★GENERATION: novel latents -> textures that are (a) NOT a copy of any training patch, (b) skin-like
(mean colour within the training family's range), (c) DIVERSE (two draws differ)
T4 persist (weights+latents) -> reload -> re-render bit-identical + PNG knowledge/nx_skinfam.png
(row 1 exemplars | row 2 reconstructions | row 3 NOVEL generations)
license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_itrig.nxnx_jpeg_ascii.nxnx_png.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 22 | const PS: i64 = 32 // patch size |
| 23 | const NPP: i64 = 1024 // px per patch |
| 24 | const NPAT: i64 = 6 // training patches |
| 25 | const NFR: i64 = 5 // Fourier freqs {1,2,4,8,16} |
| 26 | const NFF: i64 = 20 // Fourier features |
| 27 | const NL: i64 = 8 // latent dims |
| 28 | const NIN: i64 = 28 // NFF + NL |
| 29 | const NH: i64 = 56 |
| 30 | const NO: i64 = 3 |
| 31 | const EPOCHS: i64 = 500 |
functions
| 19 | func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 20 | func pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 } |
| 33 | func lcg(st: *i64) -> i64 { var h: i64=st[0]; h=h*6364136223846793005+1442695040888963407; st[0]=h; return (h>>33)&2147483647 } called by 1: main |
| 35 | func features(px: i64, py: i64, f: *i64) -> i64 |
| 52 | func infer(W1: *i64, B1: *i64, W2: *i64, B2: *i64, fin: *i64, h: *i64) -> i64 called by 1: main |
| 81 | func main() -> i64 |