code wiki / (root) / nx_f32_train_ops.nx

nx_f32_train_ops.nx

buildroot/runtime/nx_f32_train_ops.nx

2003 B47 linesdepth 4pulls 5 transitivereach 4 importersview sourcekind librarytopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_train_ops.nx -- the small reusable software-f32 TRAINING ops that close the conv training loop, composing the gated f32 tower (nx_f32_mul/add/sub/gt) with the new nx_f32_conv2d_backward. These are the shared primitives the sovereign pose-net training (operator: "build 2") uses every step: MSE loss + its gradient (heatmap regression is MSE over the target heatmaps), the ReLU backward (gradient flows only where the activation fired), and an SGD parameter step. No optimizer state here (Adam lives in nx_f32_adam); this is the minimal, gate-able core. license_tier: ORIGINAL

dependencies 3 imports · 4 importers

nx_syscalls.nx nx_f32.nx nx_f32_cvt.nx nx_f32_train_ops.nx nx_f32_conv_train_gate.nx nx_pose_backprop_gate.nx nx_pose_distill_gate.nx nx_pose_student_distill.nx

imports: nx_syscalls.nxnx_f32.nxnx_f32_cvt.nx

imported by: nx_f32_conv_train_gate.nxnx_pose_backprop_gate.nxnx_pose_distill_gate.nxnx_pose_student_distill.nx

structs

none

consts

10const K_MAGIC_8192: i64 = 8192

functions

13func f32_mse_loss(pred: *i64, target: *i64, n: i64) -> i64
26func f32_mse_grad(pred: *i64, target: *i64, dpred: *i64, n: i64) -> i64
called by 4: mainmainmainmain calls 1: nx_f32_sub
33func f32_relu_bwd(post: *i64, dpost: *i64, dpre: *i64, n: i64) -> i64
called by 3: mainmainmain calls 1: nx_f32_gt
43func f32_sgd_step(w: *i64, dw: *i64, lr: i64, n: i64) -> i64
called by 3: mainmainmain calls 2: nx_f32_subnx_f32_mul