diff --git a/BLcourse2.3/02_two_dim.py b/BLcourse2.3/02_two_dim.py index a02f4c8f09f5c5b5638a7167b42f3131e96bf7c2..1481a5dde2c7fcf65f32220e0b563cd759b3f5f0 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