From 3bd8db58184c18ddb4a5820e545d677078efef0f Mon Sep 17 00:00:00 2001 From: Rohit Singh Rathaur <42641738+TeAmP0is0N@users.noreply.github.com> Date: Thu, 20 Aug 2020 12:26:00 +0530 Subject: [PATCH] Benchmarks (#227) * added kriging surrogate with different hyper parameters * fixed some issues in gek --- docs/src/Salustowicz.md | 10 +++++----- docs/src/gek.md | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/src/Salustowicz.md b/docs/src/Salustowicz.md index 76c364694..5539b129a 100644 --- a/docs/src/Salustowicz.md +++ b/docs/src/Salustowicz.md @@ -58,9 +58,9 @@ Not's let's see Kriging Surrogate with different hyper parameter: kriging_surrogate1 = Kriging(x, y, lower_bound, upper_bound, p=0.9); kriging_surrogate2 = Kriging(x, y, lower_bound, upper_bound, p=1.5); kriging_surrogate3 = Kriging(x, y, lower_bound, upper_bound, p=1.9); -scatter(x, y, label="Sampled points", xlims=(lower_bound, upper_bound), legend=:top) -plot!(xs, salustowicz.(xs), label="True function", legend=:top) -plot!(xs, kriging_surrogate1.(xs), label="kriging_surrogate1", ribbon=p->std_error_at_point(kriging_surrogate1, p), legend=:top) -plot!(xs, kriging_surrogate2.(xs), label="kriging_surrogate2", ribbon=p->std_error_at_point(kriging_surrogate2, p), legend=:top) -plot!(xs, kriging_surrogate3.(xs), label="kriging_surrogate3", ribbon=p->std_error_at_point(kriging_surrogate3, p), legend=:top) +scatter(x, y, label="Sampled points", xlims=(lower_bound, upper_bound), legend=:topright) +plot!(xs, salustowicz.(xs), label="True function", legend=:topright) +plot!(xs, kriging_surrogate1.(xs), label="kriging_surrogate1", ribbon=p->std_error_at_point(kriging_surrogate1, p), legend=:topright) +plot!(xs, kriging_surrogate2.(xs), label="kriging_surrogate2", ribbon=p->std_error_at_point(kriging_surrogate2, p), legend=:topright) +plot!(xs, kriging_surrogate3.(xs), label="kriging_surrogate3", ribbon=p->std_error_at_point(kriging_surrogate3, p), legend=:topright) ``` diff --git a/docs/src/gek.md b/docs/src/gek.md index f136c0679..d55419623 100644 --- a/docs/src/gek.md +++ b/docs/src/gek.md @@ -37,10 +37,10 @@ plot!(f, label="True function", xlims=(lower_bound, upper_bound), legend=:top) With our sampled points we can build the Gradient Enhanced Kriging surrogate using the `GEK` function. ```@example GEK1D -my_gek = GEK(x, y, lower_bound, upper_bound, p = 2.9); +my_gek = GEK(x, y, lower_bound, upper_bound, p = 1.4); ``` ```@example @GEK1D -plot(x, y1, seriestype=:scatter, label="Sampled points", xlims=(lower_bound, upper_bound), legend=:top) +scatter(x, y1, label="Sampled points", xlims=(lower_bound, upper_bound), legend=:top) plot!(f, label="True function", xlims=(lower_bound, upper_bound), legend=:top) plot!(my_gek, label="Surrogate function", ribbon=p->std_error_at_point(my_gek, p), xlims=(lower_bound, upper_bound), legend=:top) ``` @@ -74,7 +74,7 @@ Let's define our bounds, this time we are working in two dimensions. In particul ```@example GEK_ND n_samples = 80 -lower_bound = [0, 0] +lower_bound = [0, 0] upper_bound = [10, 10] xys = sample(n_samples, lower_bound, upper_bound, SobolSample()) y1 = leon.(xys);