Datasets:
Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
Tags:
mathematics
information-theory
renyi-entropy
shannon-entropy
hidden-markov-models
bernoulli-convolutions
Download examples/make_manuscript_table.py from PureOne/VELORYN-Boundary-Kernel-Entropy: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/datasets/PureOne/VELORYN-Boundary-Kernel-Entropy/resolve/main/examples/make_manuscript_table.py
- Command line
-
hf download hf://datasets/PureOne/VELORYN-Boundary-Kernel-Entropy/examples/make_manuscript_table.py
-
curl -L -o make_manuscript_table.py https://huggingface.co/datasets/PureOne/VELORYN-Boundary-Kernel-Entropy/resolve/main/examples/make_manuscript_table.py
1.92 kB
| """Render certified rational endpoints outwards at six decimal places for the PDF.""" | |
| from fractions import Fraction as Q | |
| from pathlib import Path | |
| import json | |
| root=Path(__file__).resolve().parents[1] | |
| records=json.loads((root/'evidence'/'example_certificates.json').read_text()) | |
| labels={'phi_fair_q2':r'$\varphi$, fair iid', 'phi_markov_q2':r'$\varphi$, zero-edge Markov', | |
| 'salem_fair_q2':r'Salem, fair iid', 'salem_markov_q2':r'Salem, zero-edge Markov', | |
| 'salem_fair_q3':r'Salem, fair iid', 'variable_phi_q2':r'$\varphi$, unequal clocks', | |
| 'hidden_clock_q2':r'$\varphi$, three-state hidden', 'mixture_cusp_q2':r'Base $2$, stationary mixture', | |
| 'salem_correlated_q2':r'Salem, positive correlated', | |
| 'phi_correlated_q2':r'$\varphi$, positive correlated'} | |
| def endpoint(x,up=False): | |
| scaled=Q(x)*10**6 | |
| v=-(-scaled.numerator//scaled.denominator) if up else scaled.numerator//scaled.denominator | |
| return f'{v//10**6}.{v%10**6:06d}' | |
| rows=[] | |
| for record in records: | |
| if record['name'] not in labels: continue | |
| c=record['certificate'];lo,hi=c['interval_nats_per_branch'] | |
| rows.append(f"{labels[record['name']]} & {c['depth']} & {c['order']} & {endpoint(lo)} & " | |
| f"{endpoint(hi,True)} & {c['diagnostics']['max_layer_states']} \\\\") | |
| text='\n'.join([r'\begin{table}[htbp]',r'\centering\small',r'\setlength{\tabcolsep}{4pt}', | |
| r'\begin{tabular}{lrrrrr}',r'\toprule', | |
| r'Source / base & $n$ & $q$ & Lower & Upper & Peak states\\',r'\midrule']+rows+ | |
| [r'\bottomrule',r'\end{tabular}', | |
| r'\caption{Exact-rational rate certificates, displayed outwards to six decimal places. ' | |
| r'Rates are in nats per branch; peak states are observed layer sizes, not asymptotic bounds.}', | |
| r'\label{tab:certs}',r'\end{table}']) | |
| (root/'manuscript'/'certificate_table.tex').write_text(text+'\n') | |