diff options
Diffstat (limited to 'experiments/rain_ep_dillavou_smoke.py')
| -rw-r--r-- | experiments/rain_ep_dillavou_smoke.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/experiments/rain_ep_dillavou_smoke.py b/experiments/rain_ep_dillavou_smoke.py index 39bf5fd..3d35299 100644 --- a/experiments/rain_ep_dillavou_smoke.py +++ b/experiments/rain_ep_dillavou_smoke.py @@ -148,6 +148,30 @@ def main() -> None: assert held_innovation_error < 0.05 * held_constant_error, ( held_innovation_error, held_constant_error) + # Two distinct local neutral states identify an exactly affine field when + # the online sufficient-statistics predictor is selected. + profile_ols = DillavouUpdateCorrector( + mode="innovation", bias_ratio=0.2, predictor_rate=1.0, + calibration_steps=2, neutral_cadence=0, + empirical_profile=profile, predictor_kind="ols", seed=67) + for displacement in (-0.25, 0.25): + state = [ + value + displacement * scale + for value, scale in zip(parameters_a, parameter_scale) + ] + profile_ols.apply(clean_a, state) + ols_state = [ + value + 0.7 * scale + for value, scale in zip(parameters_a, parameter_scale) + ] + held_ols = profile_ols.apply(clean_b, ols_state) + held_ols_error = sum( + float((actual - target).square().sum()) + for actual, target in zip(held_ols, clean_b) + ) + assert held_ols_error < 1e-10, held_ols_error + assert profile_ols.debiaser.neutral_observations == 2 + # Integration check: the corruption is attached after Rain's hand-written # local EP estimator and introduces no autograd graph. energy, network, cost, augmented, minimizer, estimator = build_estimator( @@ -183,6 +207,7 @@ def main() -> None: profile.normalized_state_variations), "released_profile_heldout_mse_ratio_affine_over_constant": ( held_innovation_error / held_constant_error), + "released_profile_two_probe_ols_mse": held_ols_error, "autodiff_used_for_learning": False, }) |
