diff options
Diffstat (limited to 'experiments/protocol_smoke.py')
| -rw-r--r-- | experiments/protocol_smoke.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/experiments/protocol_smoke.py b/experiments/protocol_smoke.py index 551987c..01c914d 100644 --- a/experiments/protocol_smoke.py +++ b/experiments/protocol_smoke.py @@ -7,7 +7,7 @@ import torch sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from sdil.data import get_dataset_splits from sdil.core import SDILConfig, SDILNet -from experiments.run import calibration_work_per_event +from experiments.run import calibration_work_per_event, fixed_training_probe def loader_labels(loader): @@ -33,6 +33,15 @@ def main(): assert sum(y.numel() for _, y in validation) == 1000 assert sum(y.numel() for _, y in test) == 10000 + probe_loader = get_dataset_splits( + "mnist", batch_size=256, device="cpu", val_examples=1000, + split_seed=2027)[0] + generator_state = probe_loader.g.get_state().clone() + probe_x, probe_y = fixed_training_probe(probe_loader, 137, "cpu") + assert torch.equal(generator_state, probe_loader.g.get_state()) + assert torch.equal(probe_x, probe_loader.x[:137]) + assert torch.equal(probe_y, probe_loader.y[:137]) + net = SDILNet([10, 8, 8, 3], device="cpu") simultaneous = calibration_work_per_event( net, SDILConfig(pert_ndirs=2, pert_mode="simultaneous")) @@ -47,6 +56,7 @@ def main(): assert abs(layerwise["forward_equivalent_batches"] - 11.0 / 3.0) < 1e-12 print("validation split hash:", metadata["validation_index_sha256"]) print("train/validation/test: 59000/1000/10000; stratification exact") + print("training-prefix diagnostic probe: deterministic; shuffle state unchanged") print("simultaneous/layerwise calibration cost accounting: exact") print("ALL PROTOCOL SMOKE CHECKS PASSED") |
