PureOne's picture
LHF v3.0.0: upload batch 4 of 7
352b647 verified
Raw History Blame Contribute Delete
1.84 kB
"""Regenerate manuscript tables from the two recorded JSON result files."""
from pathlib import Path
import json
ROOT=Path(__file__).resolve().parents[1]
x=json.loads((ROOT/'data/neural_digits_results.json').read_text())
rows=[r'\begin{center}\small',r'\begin{tabular}{@{}rrrrr@{}}\toprule',
r'Noise norm & Uniform accuracy & Optimized accuracy & Uniform RMSE & Optimized RMSE\\\midrule']
for eps in [0,.025,.05,.1,.2,.4]:
a={r['method']:r for r in x['aggregates'] if r['noise_norm']==eps};u=a['uniform'];o=a['optimized']
rows.append(f"{eps:g} & {100*u['mean_accuracy']:.3f}\\% & {100*o['mean_accuracy']:.3f}\\% & {u['mean_reconstruction_RMSE']:.4f} & {o['mean_reconstruction_RMSE']:.4f}\\\\")
rows += [r'\bottomrule\end{tabular}',r'\end{center}']
(ROOT/'manuscript/neural_table.tex').write_text('\n'.join(rows))
x=json.loads((ROOT/'data/mathematical_verification.json').read_text())
names=['Two-matrix primal--dual certificates','Determinant-budget reconstruction',
'Noncommuting analytic frontier','Primal--dual target brackets','General envelope solver',
'Tensor envelope certificates','Direct-sum composition','Nonassociative memory witness',
'Envelope domination','Infinite-ellipsoid witnesses','Two-resource prior linear programs',
'Passive dilation identity','Calibration perturbation bound','False averaging simplification']
rows=[r'\begin{center}\small',r'\begin{tabularx}{\textwidth}{@{}Xrr@{}}\toprule',
r'Check group & Cases & Maximum reported residual\\\midrule']
for name,r in zip(names,x['groups']):
rows.append(name+f" & {r['cases']} & \\texttt{{{r['max_residual']:.3g}}}\\\\")
rows += [r'\midrule Total & 1,692 & All groups passed\\\bottomrule',r'\end{tabularx}\end{center}']
(ROOT/'manuscript/verification_table.tex').write_text('\n'.join(rows))
print('Two manuscript tables regenerated.')