Skip to content

Commit

Permalink
Fix typo in intro example
Browse files Browse the repository at this point in the history
See #378
  • Loading branch information
willtebbutt authored Sep 19, 2023
1 parent 92456df commit c63297f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/0-intro-1d/script.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ logpdf(fx, y_train)
# log-likelihood of the test dataset.

p_fx = posterior(fx, y_train)
logpdf(p_fx(x_test), y_test)
logpdf(p_fx(x_test, 0.1), y_test)

# We plot the posterior Gaussian process (its mean and a ribbon of 2 standard deviations
# around it) on a grid along with the observations.
Expand Down Expand Up @@ -232,7 +232,7 @@ function gp_posterior(x, y, p)
return posterior(f(x, 0.1), y)
end

mean(logpdf(gp_posterior(x_train, y_train, p)(x_test), y_test) for p in samples)
mean(logpdf(gp_posterior(x_train, y_train, p)(x_test, 0.1), y_test) for p in samples)

# We sample 5 functions from each posterior GP given by the final 100 samples of kernel
# parameters.
Expand Down Expand Up @@ -422,7 +422,7 @@ opt_kernel =
opt_f = GP(opt_kernel)
opt_fx = opt_f(x_train, 0.1)
ap = posterior(VFE(opt_f(logistic.(opt.minimizer[3:end]), jitter)), opt_fx, y_train)
logpdf(ap(x_test), y_test)
logpdf(ap(x_test, 0.1), y_test)

# We visualize the approximate posterior with optimized parameters.

Expand Down Expand Up @@ -498,7 +498,7 @@ opt_kernel =
opt_f = GP(opt_kernel)
opt_fx = opt_f(x_train, 0.1)
opt_p_fx = posterior(opt_fx, y_train)
logpdf(opt_p_fx(x_test), y_test)
logpdf(opt_p_fx(x_test, 0.1), y_test)

# We visualize the posterior with optimized parameters.

Expand Down

0 comments on commit c63297f

Please sign in to comment.