Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
continual-learning
catastrophic-forgetting
functional-memory
orthogonal-projection
statistical-certification
pytorch
|
Download examples/README.md from PureOne/Eidrion: direct link, hf CLI and curl.
- Browser
- Download file 5.26 kB
-
https://huggingface.co/datasets/PureOne/Eidrion/resolve/main/examples/README.md
- Command line
-
hf download hf://datasets/PureOne/Eidrion/examples/README.md
-
curl -L -o README.md https://huggingface.co/datasets/PureOne/Eidrion/resolve/main/examples/README.md
5.26 kB
| # Core quickstart | |
| Run from the release root, keeping `examples/` adjacent to `src/`: | |
| ```sh | |
| python examples/quickstart.py --output /tmp/avenyra_omega_quickstart | |
| ``` | |
| The script uses generated arrays with independent fitting, calibration, and evaluation RNG streams. It is an API example and engineering check, not a natural-data benchmark. The recorded run is in `quickstart_result/report.json`; output directories must be new. | |
| It demonstrates an admitted center update, two registered class-conditional calibration attempts, ordinary Adam training of every layer of a raw neural residual, the bounded output contract, model/feature/memory/certificate/optimizer checkpoint restoration, and an exact matched optimizer-resume step. A separate fresh-evidence example accepts one fixed candidate, refuses another using different source observations, and retains the accepted checkpoint. | |
| ## Relevant API calls | |
| ```python | |
| features = FrozenFeatures(input_dim=8, kind="linear", seed=7000) | |
| memory = OrthogonalMemory( | |
| feature_dim=features.feature_dim, | |
| classes=3, | |
| feature_signature=features.signature, | |
| failure_budget=0.05, | |
| ) | |
| proposal = memory.ridge_proposal( | |
| features(fit_x), target_logits, ridge=0.001 | |
| ) | |
| event = memory.admit( | |
| proposal, residual_radius=0.0, label="initial center" | |
| ) | |
| center_logits, power = memory.center_and_power(features(calibration_x)) | |
| scores = acquisition_scores(center_logits, reference_logits, power) | |
| certificate = memory.calibrate_acquisition( | |
| scores, | |
| task=0, | |
| risk=0.05, | |
| failure_probability=0.025, | |
| independent_calibration=True, | |
| stratum="old_class0", | |
| distribution="declared old class population", | |
| reference_id="fit-only reference fixed before calibration", | |
| ) | |
| if certificate.status == "CONDITIONAL": | |
| memory.add_certificate(certificate) | |
| raw_model = ResidualMLP(input_dim=8, classes=3, width=24) | |
| model = BoundedResidualClassifier(features, memory, raw_model, radius=0.0) | |
| radius = model.set_certified_radius(cap=0.6) | |
| optimizer = torch.optim.Adam(model.raw_model.parameters(), lr=0.02) | |
| ``` | |
| These are actual signatures of the shipped core. The complete script supplies the tensors and provenance omitted from this short fragment. `calibrate_acquisition` registers **every** attempt before a threshold is admitted, so failures consume confidence as well. A positive threshold below the numerical slack can still be refused by `add_certificate`; never silently call an unregistered external calibration function when a global budget is active. The boolean independence flag is not a substitute for disjoint data construction. | |
| The envelope feature map remains frozen. Every parameter of `raw_model`, including its hidden layers, can train. This does not mean the entire architecture has unrestricted learning capacity: zero power, insufficient radius, global center-energy budgets, and the raw model's own optimization can still block progress. | |
| The separate renewal API is: | |
| ```python | |
| fresh = FreshRiskController(failure_budget=0.05) | |
| event = fresh.evaluate_candidate( | |
| blocks, # {stratum: {"errors": bool_vector, "source_ids": int_vector}} | |
| candidate_id="candidate fixed before these observations", | |
| risk=0.05, | |
| failure_probability=0.01, | |
| fixed_before_evidence=True, | |
| required_strata=["class0", "class1"], | |
| ) | |
| ``` | |
| The controller requires globally unique original-observation IDs across its calls, consumes rejected evidence/confidence, and refuses to replace the deployed candidate if any required stratum fails. Its guarantee is per accepted checkpoint; it is different from the nested envelope's fixed-score ever-flip bound. | |
| ## Recorded generated-data behavior | |
| The initial center update added two protected directions. Two independent class-calibration attempts used256 observations each, allocated.025 confidence failure each, and produced order-statistic thresholds approximately50.07856 and49.55950. The example chose radius.6, below both budgets. | |
| All six raw-network weight/bias tensors moved during40 Adam steps. New-fit cross-entropy changed from1.45238 to1.08552. The generated new-fit accuracy was100%, while the independently drawn old evaluation sample had100% accuracy and0 observed changes relative to its acquisition reference. These favorable toy numbers illustrate the API; they are not claimed as real-benchmark or universal retention evidence. The new-fit metric is training accuracy, not new-task held-out accuracy. | |
| Predictions, optimizer state, and a matched resumed step were exactly equal after the saved full checkpoint was restored in the same environment. The fixed feature signature remained unchanged. The separate fresh controller accepted its first predeclared rule and refused its inverted rule, consumed1024 distinct observations and.04 confidence failure in total, and retained the first candidate. Its state also round-tripped exactly. | |
| The certificate theorem is an exact-real conditional statement. These executions use diagnostic float64 geometry with an ordinary float32 neural network; they do not independently certify every numerical roundoff bound from the mathematical numerical supplement. A recorded small invariant residual or zero empirical flips is not by itself a proof of a uniform finite-precision population guarantee. | |