Datasets:
Formats:
json
Languages:
English
Size:
< 1K
Tags:
artificial-intelligence
recursive-self-improvement
continual-learning
representation-learning
world-models
cognitive-architecture
Download examples/minimal_cycle.py from PureOne/FNE-AXIOMESH: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/datasets/PureOne/FNE-AXIOMESH/resolve/main/examples/minimal_cycle.py
- Command line
-
hf download hf://datasets/PureOne/FNE-AXIOMESH/examples/minimal_cycle.py
-
curl -L -o minimal_cycle.py https://huggingface.co/datasets/PureOne/FNE-AXIOMESH/resolve/main/examples/minimal_cycle.py
1.47 kB
| """A minimal executable CQW -> Split -> Unison cycle. | |
| Run from the package root: python examples/minimal_cycle.py | |
| The oracle is explicit and charged; no information is recovered from nothing. | |
| """ | |
| from pathlib import Path | |
| import sys | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'src')) | |
| import numpy as np | |
| from axiomesh.core import Memory, weave, split_with_tether, hole_certificate | |
| p = 101 | |
| Q = np.array([[1, 0, 0]], dtype=np.int64) | |
| a = np.eye(3, dtype=np.int64); a[0, 1] = 1 | |
| b = np.eye(3, dtype=np.int64); b[1, 2] = 1 | |
| ops = {"a": a, "b": b} | |
| h = np.array([3, 4, 2], dtype=np.int64) | |
| partial = Memory(np.array([[1, 0, 0], [0, 1, 0]], dtype=np.int64), | |
| np.array([3, 4], dtype=np.int64), p) | |
| result = weave(Q, ops, partial) | |
| assert result.status == "ambiguous" | |
| print('Before acquisition:', hole_certificate(result.closure, partial)) | |
| result = weave(Q, ops, partial, | |
| oracle=lambda row: int(row @ h) % p, | |
| observation_budget=1, erasure_budget=1) | |
| assert result.status == "committed" | |
| assert result.offspring.run(["b", "a"]).tolist() == [9] | |
| fracture = split_with_tether(Q, ops, result.memory, partitions=[["a"], ["b"]]) | |
| rejoined = fracture.reunify() | |
| assert rejoined.status == "committed" | |
| assert rejoined.offspring.run(["b", "a"]).tolist() == [9] | |
| print({'observations_acquired': result.acquisitions, | |
| 'tether_symbols': fracture.tether_symbols, | |
| 'regenerated_output': rejoined.offspring.run(['b', 'a']).tolist()}) | |