code wiki / (root) / nx_pose_distill_gate.nx

nx_pose_distill_gate.nx

buildroot/runtime/nx_pose_distill_gate.nx

6015 B107 linesdepth 6pulls 12 transitivereach 0 importersview sourcekind gate/prooftopic pose
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_f32.nx nx_f32_cvt.nx nx_f32_div.nx nx_f32_exp.nx nx_f32_conv2d.nx nx_f32_conv2d_backward.nx nx_pose_cnn.nx nx_f32_train_ops.nx nx_pck.nx nx_pose_distill_gate.nx

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

main sys_mmap mk nx_f32_div nx_f32_classify nx_f32_exp_field nx_f32_mant_field nx_f32_sign nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_i32_to_f32 nx_f32_exp nx_f32_classify ↻ nx_f32_sign ↻ _f32_to_i32_rne nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_exp_field ↻ nx_f32_mant_field ↻ nx_i32_to_f32 ↻ _f32_ldexp nx_f32_classify ↻ nx_f32_exp_field ↻ nx_f32_sign ↻ nx_f32_mul nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_i32_to_f32 ↻ nx_q14_to_f32 nx_i32_to_f32 ↻ nx_f32_conv2d_forward nx_f32_add nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_f32_mul ↻ pose_cnn_relu

structs

none

consts

none

functions

18func gp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return sys_write(1,s,n) }
called by 1: main calls 1: sys_write
19func 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) }
called by 1: main calls 2: sys_mmapsys_write
20func mk(n: i64, d: i64) -> i64 { return nx_f32_div(nx_i32_to_f32(n), nx_i32_to_f32(d)) }
called by 1: main calls 2: nx_f32_divnx_i32_to_f32
23func hm_argmax(heat: *i64, j: i64, ox: *i64, oy: *i64) -> i64
called by 1: main calls 1: nx_f32_gt
31func main(argc: i64, argv: *i64) -> i64