code wiki / _hdl_build / _ce_grad_gate_authored.nx

_ce_grad_gate_authored.nx

buildroot/runtime/_hdl_build/_ce_grad_gate_authored.nx

4630 B106 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

_ce_grad_gate_authored.nx -- the VERIFIED-GRADIENT gate for tg_celoss (op 6, fused softmax+cross-entropy), per the law established at T7: every op lands WITH its gradcheck. GATES: A gradcheck (analytic == central finite difference, all 5 logits, h=1/128, rel<1/32 floor 1/64) | B KAT uniform logits -> CE == ln(n) (the mathematical anchor, oracle = nx_f32_log itself on a DIFFERENT path: log(5) vs logsumexp of equal shifts) | C conservation (softmax - onehot sums to 0 => analytic grads sum to ~0). LAWS: flat ifs, no &&/||. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_tgrad_core.nx _ce_grad_gate_authored.nx

imports: nx_tgrad_core.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main _tg_puts sys_write tg_q 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_neg nx_i32_to_f32 ↻ tg_leaf tg_node _tg_puts ↻ sys_exit tg_alloc _tg_puts ↻ sys_exit ↻ tg_celoss tg_valp nx_f32_gt nx_f32_lt nx_f32_is_nan nx_f32_classify ↻ nx_f32_is_zero nx_f32_classify ↻ tg_alloc ↻ nx_f32_sub nx_f32_add nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_f32_neg ↻ nx_f32_exp nx_f32_classify ↻ nx_f32_sign ↻

structs

none

consts

none

functions

11func ce_fwd(pv: *i64, tv: *i64, n: i64) -> i64
30func main() -> i64