nx_pose_distill_gate.nx
buildroot/runtime/nx_pose_distill_gate.nx
about
nx_pose_distill_gate.nx -- BUILD-2 core proof: a small STUDENT pose net TRAINS (the distillation loop) to
reproduce target keypoints, composing the gated training primitives. Student = conv1(4->8,3x3,pad1) -> ReLU ->
conv2(8->3,1x1) -> 3 heatmaps [3,8,6]; target = gaussian bumps at 3 chosen keypoints. Loop: forward -> MSE grad
-> conv2 backward -> ReLU backward -> conv1 backward -> SGD. Verify loss collapses AND the student's argmax
keypoints converge to the targets (PCK 0 -> high). This is the mechanism the REAL distillation scales: the ViTPose
reference is the teacher, this small net is the student, graded by nx_pck. expect_exit: 0
dependencies 10 imports · 0 importers
imports: nx_syscalls.nxnx_f32.nxnx_f32_cvt.nxnx_f32_div.nxnx_f32_exp.nxnx_f32_conv2d.nxnx_f32_conv2d_backward.nxnx_pose_cnn.nxnx_f32_train_ops.nxnx_pck.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
| none |
functions
| 18 | func gp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return sys_write(1,s,n) } |
| 19 | func gn(v: i64) -> i64 { let bb:*u8=sys_mmap(28); var m:i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} let t:*u8=sys_mmap(28); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} return sys_write(1,bb,k) } |
| 20 | func mk(n: i64, d: i64) -> i64 { return nx_f32_div(nx_i32_to_f32(n), nx_i32_to_f32(d)) } |
| 23 | func hm_argmax(heat: *i64, j: i64, ox: *i64, oy: *i64) -> i64 |
| 31 | func main(argc: i64, argv: *i64) -> i64 |