From a69f00171cfa24d99b02e13f4043266404ff0b05 Mon Sep 17 00:00:00 2001 From: Steve Schmerler <git@elcorto.com> Date: Thu, 8 May 2025 14:36:56 +0200 Subject: [PATCH] gp: 02_two_dim: sync noise test with 01_one_dim --- BLcourse2.3/02_two_dim.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/BLcourse2.3/02_two_dim.py b/BLcourse2.3/02_two_dim.py index a02f4c8..1481a5d 100644 --- a/BLcourse2.3/02_two_dim.py +++ b/BLcourse2.3/02_two_dim.py @@ -336,16 +336,24 @@ for ax, c in zip(axs, cs): fig.colorbar(c, ax=ax) # - -# # Check learned noise + +# # Let's check the learned noise # + -print((post_pred_y.stddev**2 - post_pred_f.stddev**2).mean().sqrt()) +# Target noise to learn +print("data noise:", noise_std) + +# The two below must be the same print( + "learned noise:", + (post_pred_y.stddev**2 - post_pred_f.stddev**2).mean().sqrt().item(), +) +print( + "learned noise:", np.sqrt( extract_model_params(model, raw=False)["likelihood.noise_covar.noise"] - ) + ), ) -print(noise_std) # - # # Plot confidence bands -- GitLab