Datasets:
Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
Tags:
mathematics
information-theory
renyi-entropy
shannon-entropy
hidden-markov-models
bernoulli-convolutions
Download examples/cross_version_regression.py from PureOne/VELORYN-Boundary-Kernel-Entropy: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/datasets/PureOne/VELORYN-Boundary-Kernel-Entropy/resolve/main/examples/cross_version_regression.py
- Command line
-
hf download hf://datasets/PureOne/VELORYN-Boundary-Kernel-Entropy/examples/cross_version_regression.py
-
curl -L -o cross_version_regression.py https://huggingface.co/datasets/PureOne/VELORYN-Boundary-Kernel-Entropy/resolve/main/examples/cross_version_regression.py
1.22 kB
| """Reproduce the three exact fair-Salem moments recorded by the input v6 release. | |
| These fixed integer constants are historical regression targets, not independent | |
| proofs. No file or code from the earlier release is required to run this script. | |
| """ | |
| from fractions import Fraction as Q | |
| from pathlib import Path | |
| import json | |
| import sys | |
| sys.path.insert(0,str(Path(__file__).resolve().parents[1])) | |
| from veloryn import collision_matrix | |
| from veloryn.examples import fair | |
| TARGETS={20:4119392,64:15531370961563437757056, | |
| 128:1930790484095185524333598330165083738834124712} | |
| records=[] | |
| for n,numerator in TARGETS.items(): | |
| matrix,diag=collision_matrix(fair('salem'),n,2) | |
| expected=Q(numerator,4**n) | |
| if matrix[0][0]!=expected: | |
| raise AssertionError(f'exact v6 regression failed at depth {n}') | |
| records.append({'depth':n,'historical_numerator':str(numerator), | |
| 'historical_denominator':'4**'+str(n), | |
| 'exact_match':True,'max_layer_states':diag['max_layer_states']}) | |
| print('exact fair-Salem regression passed:',n,flush=True) | |
| root=Path(__file__).resolve().parents[1] | |
| (root/'evidence'/'cross_version_regression.json').write_text(json.dumps(records,indent=2)+'\n') | |