diff options
Diffstat (limited to 'experiments/baseline_smoke.py')
| -rw-r--r-- | experiments/baseline_smoke.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/experiments/baseline_smoke.py b/experiments/baseline_smoke.py index c656a2f..324e333 100644 --- a/experiments/baseline_smoke.py +++ b/experiments/baseline_smoke.py @@ -8,6 +8,8 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from sdil.data import onehot from sdil.local_baselines import FANet, PEPITANet, FFNet, EPNet from sdil import probes +from experiments.import_native_baseline import (summarize_burst_history, + summarize_dualprop_hist) def check_fa_residual_transport(): @@ -133,9 +135,40 @@ def check_ep_energy_dynamics(): print("EP free particles persist across presentations") +def check_native_result_selection(): + burst_rows = [ + {"epoch": 0, "epoch/top1_error/test": 30.0, + "epoch/top1_error/val": 28.0, "_runtime": 10.0}, + {"epoch": 1, "epoch/top1_error/test": 20.0, + "epoch/top1_error/val": 22.0, "_runtime": 20.0}, + {"epoch": 2, "epoch/top1_error/test": 21.0, + "epoch/top1_error/val": 18.0, "_runtime": 30.0}, + ] + burst = summarize_burst_history(burst_rows, 3) + assert burst["primary_final_test_accuracy_percent"] == 79.0 + assert burst["validation_selected_epoch"] == 2 + assert burst["validation_selected_test_accuracy_percent"] == 79.0 + assert burst["test_selected_epoch"] == 1 + assert burst["test_selected_test_accuracy_percent"] == 80.0 + + dual = summarize_dualprop_hist({ + "train_loss": [2.0, 1.0], "train_accuracy": [30.0, 70.0], + "train_time": [4.0, 5.0], "val_loss": [1.5, 1.2], + "val_accuracy": [60.0, 65.0], "val_top5accuracy": [90.0, 92.0], + "val_time": [1.0, 1.5], "test_loss": 1.1, + "test_accuracy": 64.0, "test_top5accuracy": 93.0, "test_time": 2.0, + }, 2) + assert dual["validation_selected_epoch"] == 2 + assert dual["primary_test_accuracy_percent"] == 64.0 + assert dual["test_evaluations"] == 1 + assert dual["wall_s"] == 13.5 + print("native final/validation-selected/test-selected semantics: exact") + + if __name__ == "__main__": check_fa_residual_transport() check_pepita_output_rule() check_ff_local_optimization() check_ep_energy_dynamics() + check_native_result_selection() print("ALL BASELINE SMOKE CHECKS PASSED") |
