Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in intro example #379

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading