Restructure: descriptive tier and experiment names, paper/manuscript
- paper/pnas -> paper/manuscript (venue-neutral)
- configs/layer1 -> configs/inheritance, src/knowledge -> src/inheritance
(imported as `inheritance`), make layer1 -> make inheritance; layer2 alias dropped
- inheritance and trained-network bundles named after the manuscript figure
they feed (fig2_grounding_sweep, figS3_rebaselining, ...), or descriptively
where they feed none; configs keep their `experiment:` value so parquet
hashes are unchanged, only output.dir moves
- figure scripts, SI figure sources, notebooks, REPRODUCING.md, README and the
SI Methods/tables updated; make clean no longer deletes tracked manifests;
reproduce.sh hashes the s{seed}/ layouts too
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y64o8FKP7rCuXzC48pxpMm
This commit is contained in:
parent
84124de143
commit
ab3dc10587
240 changed files with 477 additions and 476 deletions
|
|
@ -8,8 +8,8 @@ import numpy as np
|
|||
import pandas as pd
|
||||
import pytest
|
||||
|
||||
from knowledge.analysis import reduce_to_stationary, critical_grounding
|
||||
from knowledge.metrics import tail_band_metrics
|
||||
from inheritance.analysis import reduce_to_stationary, critical_grounding
|
||||
from inheritance.metrics import tail_band_metrics
|
||||
|
||||
|
||||
def _H_eq(n, m, Hs):
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ from __future__ import annotations
|
|||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from knowledge.config import LineageCfg
|
||||
from knowledge.metrics import forward_kl, heterozygosity, support_size, tail_mass
|
||||
from knowledge.step import allocate_m, apply_selection, generation_step, StepCtx, \
|
||||
from inheritance.config import LineageCfg
|
||||
from inheritance.metrics import forward_kl, heterozygosity, support_size, tail_mass
|
||||
from inheritance.step import allocate_m, apply_selection, generation_step, StepCtx, \
|
||||
structured_multinomial
|
||||
from knowledge.teachers import make_correlated_teachers, make_retention_matrix
|
||||
from knowledge.truth import make_true_distribution, uniform_init
|
||||
from knowledge.lineage import run_lineage
|
||||
from inheritance.teachers import make_correlated_teachers, make_retention_matrix
|
||||
from inheritance.truth import make_true_distribution, uniform_init
|
||||
from inheritance.lineage import run_lineage
|
||||
|
||||
|
||||
# ---- truth --------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from __future__ import annotations
|
|||
|
||||
import numpy as np
|
||||
|
||||
from knowledge.dynamic_society import _conformity, _consensus, _novelty, run_dynamic_society
|
||||
from inheritance.dynamic_society import _conformity, _consensus, _novelty, run_dynamic_society
|
||||
|
||||
|
||||
def _run(arm_overrides: dict, seed: int = 0, gens: int = 50):
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ from __future__ import annotations
|
|||
|
||||
import numpy as np
|
||||
|
||||
from knowledge.genotype import (
|
||||
from inheritance.genotype import (
|
||||
additive_fitness, bits_to_index, crossover, genotype_bits, hill_climb, linkage_equilibrium,
|
||||
locus_marginals, mutate, nk_fitness, recombine, recombine_teachers,
|
||||
)
|
||||
from knowledge.genotype_lineage import run_genotype_lineage
|
||||
from knowledge.society import make_specialist, run_directed_sex, run_recomb_landscape, run_society
|
||||
from knowledge.teachers import make_retention_matrix
|
||||
from inheritance.genotype_lineage import run_genotype_lineage
|
||||
from inheritance.society import make_specialist, run_directed_sex, run_recomb_landscape, run_society
|
||||
from inheritance.teachers import make_retention_matrix
|
||||
|
||||
|
||||
def test_genotype_bits_and_additive_fitness():
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ from __future__ import annotations
|
|||
|
||||
import numpy as np
|
||||
|
||||
from knowledge.kernel import LearningKernelCfg, apply_kernel
|
||||
from knowledge.lineage import run_lineage
|
||||
from knowledge.metrics import heterozygosity
|
||||
from inheritance.kernel import LearningKernelCfg, apply_kernel
|
||||
from inheritance.lineage import run_lineage
|
||||
from inheritance.metrics import heterozygosity
|
||||
|
||||
|
||||
def test_apply_kernel_identity_is_noop():
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ from __future__ import annotations
|
|||
|
||||
import numpy as np
|
||||
|
||||
from knowledge.mating_system import _distinct_peaks, _diversity, run_mating_system
|
||||
from knowledge.genotype import nk_fitness
|
||||
from inheritance.mating_system import _distinct_peaks, _diversity, run_mating_system
|
||||
from inheritance.genotype import nk_fitness
|
||||
|
||||
|
||||
def _run(breadth: float, K: int = 6, seed: int = 0, gens: int = 40, N: int = 32, L: int = 10):
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import pytest
|
|||
|
||||
pytest.importorskip("torchvision")
|
||||
|
||||
from knowledge.metrics import forward_kl # noqa: E402
|
||||
from inheritance.metrics import forward_kl # noqa: E402
|
||||
from neural.config import MnistCfg, ModelCfg, OracleCfg # noqa: E402
|
||||
from neural.mnist_data import ( # noqa: E402
|
||||
MnistSampler, assign_modes, fit_thickness_thresholds, make_mnist_truth, thickness_bin,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import pytest
|
|||
|
||||
pytest.importorskip("torch")
|
||||
|
||||
from knowledge.metrics import forward_kl, heterozygosity # noqa: E402
|
||||
from inheritance.metrics import forward_kl, heterozygosity # noqa: E402
|
||||
from neural.config import ModelCfg, SyntheticCfg # noqa: E402
|
||||
from neural.generation_loop import run_generative_lineage # noqa: E402
|
||||
from neural.models import make_model # noqa: E402
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ With ``model.kind == "histogram"`` the neural generational step (train-on-parent
|
|||
+ grounding) is *exactly* neutral Wright-Fisher drift with immigration. This module asserts
|
||||
that the neural runner reproduces the two closed forms Layer 1 is validated against
|
||||
(blueprint 2.4-1 neutral heterozygosity decay, 2.4-3 exact mutation-drift equilibrium) and
|
||||
that its mean H-trajectory tracks ``knowledge.lineage.run_lineage`` directly. If any of
|
||||
that its mean H-trajectory tracks ``inheritance.lineage.run_lineage`` directly. If any of
|
||||
these fail the neural plumbing is wrong — no real network should be trained until they pass.
|
||||
"""
|
||||
|
||||
|
|
@ -13,8 +13,8 @@ from __future__ import annotations
|
|||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from knowledge.lineage import run_lineage
|
||||
from knowledge.seeding import spawn_seeds
|
||||
from inheritance.lineage import run_lineage
|
||||
from inheritance.seeding import spawn_seeds
|
||||
from neural.generation_loop import run_generative_lineage
|
||||
from neural.synthetic import make_mode_truth
|
||||
from neural.config import SyntheticCfg
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ check (the simulator reproduces known population-genetics results) and a code ch
|
|||
(the implementation is correct). If any test here fails, the science is wrong, not
|
||||
just the code -- do not trust any downstream Layer-1 figure until these pass.
|
||||
|
||||
The Layer-1 implementation in `src/knowledge/` is DONE, for validation purposes,
|
||||
The Layer-1 implementation in `src/inheritance/` is DONE, for validation purposes,
|
||||
when the conformance tests in Part 5 pass against the real package.
|
||||
|
||||
HOW IT IS STRUCTURED
|
||||
|
|
@ -98,7 +98,7 @@ def theory_union_coverage_fraction(K_T: int, rho: float, q: float) -> float:
|
|||
# =====================================================================================
|
||||
#
|
||||
# This is the smallest correct implementation of the core Layer-1 dynamics. It exists
|
||||
# so the spine tests can run before src/knowledge/ is written, and so the exact
|
||||
# so the spine tests can run before src/inheritance/ is written, and so the exact
|
||||
# semantics the package must reproduce are unambiguous. The package will do far more
|
||||
# (config, logging, regions, selection, re-minting, per-region metrics); it must agree
|
||||
# with THIS on the analytic-check subset.
|
||||
|
|
@ -388,8 +388,8 @@ class TestMetricSanity:
|
|||
# from the minimal one built here, adapt the *construction* of cfg, never the tolerance.
|
||||
|
||||
try:
|
||||
import knowledge.metrics as knowledge_metrics
|
||||
import knowledge.teachers as knowledge_teachers
|
||||
import inheritance.metrics as knowledge_metrics
|
||||
import inheritance.teachers as knowledge_teachers
|
||||
HAVE_KNOWLEDGE = True
|
||||
except Exception: # package not built yet -> conformance layer skips, spine still runs
|
||||
knowledge_metrics = knowledge_teachers = None
|
||||
|
|
@ -440,7 +440,7 @@ class TestPackageDynamicsConform:
|
|||
|
||||
def _run_lineage(self, cfg_overrides, seed):
|
||||
lineage = pytest.importorskip(
|
||||
"knowledge.lineage", reason="Layer-1 package not implemented yet")
|
||||
"inheritance.lineage", reason="Layer-1 package not implemented yet")
|
||||
base = {
|
||||
"truth": {"K": 50, "R": 1, "tail": "zipf", "zipf_s": 1.1,
|
||||
"tail_frac": 0.5, "tail_threshold": 1e-3},
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
|||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from knowledge.speciation import _bdm_point, _nk_point, run_speciation
|
||||
from inheritance.speciation import _bdm_point, _nk_point, run_speciation
|
||||
|
||||
|
||||
def test_bdm_parents_carry_no_incompatibility():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue