This repository includes minimal, reproducible toy demos for:
- Occam tie-breaker (complexity regularization)
- Respect as a hard constraint (safety-first boundary corridor)
- Python 3.10+ (tested with 3.11)
- NumPy
- SciPy
From the repo root:
python3 -m pip install -U pip
python3 -m pip install -e .If you run into permission issues on macOS:
python3 -m pip install --user -e .cd examples
# Occam demo
python3 occam_demo.py
# Respect demo
python3 respect_boundary_demo.pyYou should see:
x_bestclose to the simpler basin (e.g. ~0.1)- a breakdown like:
- Harmony contribution
- Occam contribution (
occam_lambda * complexity)
You should see:
- best x inside the allowed region
- a constraint diagnostic report such as:
- status: OK
- margin: small positive value (near boundary is normal)
Respect (R) is implemented as a hard inequality constraint:
- Each constraint is a margin function
g(state) >= 0 - Violations are penalized with a large quadratic term
- With sufficiently large
safety_lambda, unsafe solutions become unstable minima
This provides a safety-first default without post-hoc filtering.
Use a fixed random seed for annealing:
seed=42Optional: lock exact versions
python3 -m pip freeze > requirements-lock.txt