diff --git a/code/verify_math.py b/code/verify_math.py index 7d854df..aec8737 100644 --- a/code/verify_math.py +++ b/code/verify_math.py @@ -289,6 +289,30 @@ def v8_cross_period_terms(): return ok +def v9_score_variance_ratio(): + """Per-digit score-variance ratio of Proposition 1's proof: the mean + of sum_j e_j^4 / sum_j e_j^2 e'_j^2 over ordered codeword pairs of + the trained unit codebook, quoted as 2.8 in the manuscript.""" + import torch + from exp_full import main_model + m = main_model() + B = m.unit_codebook().detach().cpu().double() + B = B / B.norm(dim=1, keepdim=True) + n = B.shape[0] + num = (B ** 4).sum(1) + ratios = [] + for i in range(n): + for j in range(n): + if i != j: + ratios.append(float(num[i] / (B[i] ** 2 * B[j] ** 2).sum())) + mean = sum(ratios) / len(ratios) + ok = abs(mean - 2.8) < 0.05 + print("V9 per-digit score-variance ratio: %.3f (quoted 2.8)" % mean) + ROWS.append(("V9 score-variance ratio", "2.8", "%.4f" % mean, + "%.4f" % abs(mean - 2.8), "0.05", "PASS" if ok else "FAIL")) + return ok + + def main(): print(f"config d={D} U={U} V={V}\n") results = { @@ -300,6 +324,7 @@ def main(): "V6": v6_coded_oma_outage(), "V7": v7_symbolic_identities(), "V8": v8_cross_period_terms(), + "V9": v9_score_variance_ratio(), } print("\nsummary:", {k: ("PASS" if v else "FAIL") for k, v in results.items()}) print("ALL PASS" if all(results.values()) else "SOME FAILED") diff --git a/data/verify_math.csv b/data/verify_math.csv index a7267e8..e300001 100644 --- a/data/verify_math.csv +++ b/data/verify_math.csv @@ -5,10 +5,11 @@ V2b eve SER @ 0dB,0.99609375,0.995,0.0010937500000000044,0.015,PASS V2b eve SER @ 10dB,0.99609375,0.9888333333333333,0.007260416666666658,0.015,PASS V2b eve SER @ 20dB,0.99609375,0.9881666666666666,0.007927083333333362,0.015,PASS V2b eve SER @ 80dB,0.99609375,0.9896666666666667,0.0064270833333333055,0.015,PASS -V3b random mask E|corr|,0.09973557010035818,0.10187042771408686,0.002134857613728683,0.009973557010035819,PASS +V3b random mask E|corr|,0.09973557010035818,0.10187042771408686,0.002134857613728683,0.002992067103010745,PASS V4a blind jammer projection mean,0.0,0.00026396107284673695,0.00026396107284673695,0.003,PASS -V4b blind jammer projection variance,0.01558576233568703,0.015476787953278994,0.00010897438240803532,0.0007792881167843516,PASS +V4b blind jammer projection variance,0.01558576233568703,0.015476787953278994,0.00010897438240803532,0.0001558576233568703,PASS V5 matched bias over blind RMS,8.0,8.0,0.04,1.0,PASS V6 coded-OMA outage @ 10 dB,0.0406,0.040575,0,0,REFERENCE V7 symbolic identities,exact,exact,0,0,PASS -V8 cross-period remainder,0.0,0.000337,0.000337,0.01,PASS +V8 cross-period remainder,0.0,0.000337,0.000337,0.0005,PASS +V9 score-variance ratio,2.8,2.8252,0.0252,0.05,PASS