Skip to content

Commit

Permalink
julia format
Browse files Browse the repository at this point in the history
  • Loading branch information
odunbar committed Apr 23, 2024
1 parent 18344e8 commit fe4daee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 44 deletions.
54 changes: 11 additions & 43 deletions examples/Sinusoid/emulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,7 @@ p2 = contour(
ylabel = "Vertical Shift",
title = "True Sinusoid Mean",
)
p = plot(
p1,
p2,
size = (600, 300),
layout = (1, 2),
guidefontsize = 14,
tickfontsize = 12,
legendfontsize = 12,
)
p = plot(p1, p2, size = (600, 300), layout = (1, 2), guidefontsize = 14, tickfontsize = 12, legendfontsize = 12)
savefig(p, joinpath(data_save_directory, "sinusoid_groundtruth_contours.png"))
# The first panel shows how the range varies with respect to the two parameters in the Gaussian process
# emulator. The contours show the range is mostly dependent on the amplitude, with little variation with
Expand Down Expand Up @@ -223,8 +215,8 @@ plot!(inputs[1, :], inputs[2, :]; seriestype = :scatter, zcolor = outputs[2, :],
p = plot(
p1,
p2,
right_margin=3mm,
bottom_margin=3mm,
right_margin = 3mm,
bottom_margin = 3mm,
size = (600, 300),
layout = (1, 2),
guidefontsize = 14,
Expand Down Expand Up @@ -258,9 +250,9 @@ p2 = contour(
plot!(inputs[1, :], inputs[2, :]; seriestype = :scatter, zcolor = outputs[2, :], label = :false)
p = plot(
p1,
p2,
right_margin=3mm,
bottom_margin=3mm,
p2,
right_margin = 3mm,
bottom_margin = 3mm,
size = (600, 300),
layout = (1, 2),
guidefontsize = 14,
Expand Down Expand Up @@ -305,8 +297,8 @@ p = plot(
p2,
size = (600, 300),
layout = (1, 2),
right_margin=3mm,
bottom_margin=3mm,
right_margin = 3mm,
bottom_margin = 3mm,
guidefontsize = 14,
tickfontsize = 12,
legendfontsize = 12,
Expand Down Expand Up @@ -337,15 +329,7 @@ p2 = contour(
ylabel = "Vertical Shift",
title = "RF 1σ in Sinusoid Mean",
)
p = plot(
p1,
p2,
size = (600, 300),
layout = (1, 2),
guidefontsize = 14,
tickfontsize = 12,
legendfontsize = 12,
)
p = plot(p1, p2, size = (600, 300), layout = (1, 2), guidefontsize = 14, tickfontsize = 12, legendfontsize = 12)
savefig(p, joinpath(data_save_directory, "sinusoid_RF_emulator_std_contours.png"))
# The GP and RF uncertainty predictions are similar and show lower uncertainties around the region of interest
# where we have more training points.
Expand Down Expand Up @@ -377,15 +361,7 @@ p2 = contour(
ylabel = "Vertical Shift",
title = "GP error in Sinusoid Mean",
)
p = plot(
p1,
p2,
size = (600, 300),
layout = (1, 2),
guidefontsize = 14,
tickfontsize = 12,
legendfontsize = 12,
)
p = plot(p1, p2, size = (600, 300), layout = (1, 2), guidefontsize = 14, tickfontsize = 12, legendfontsize = 12)
savefig(p, joinpath(data_save_directory, "sinusoid_GP_errors_contours.png"))

rf_diff_grid = abs.(rf_grid - g_true_grid)
Expand All @@ -411,15 +387,7 @@ p2 = contour(
ylabel = "Vertical Shift",
title = "RF error in Sinusoid Mean",
)
p = plot(
p1,
p2,
size = (600, 300),
layout = (1, 2),
guidefontsize = 14,
tickfontsize = 12,
legendfontsize = 12,
)
p = plot(p1, p2, size = (600, 300), layout = (1, 2), guidefontsize = 14, tickfontsize = 12, legendfontsize = 12)
savefig(p, joinpath(data_save_directory, "sinusoid_RF_errors_contours.png"))

# Here, we want the emulator to show the low errors in the region around the true parameter values near θ = (3, 6),
Expand Down
2 changes: 1 addition & 1 deletion examples/Sinusoid/sinusoid_setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function generate_obs(amplitude_true, vert_shift_true, Γ; rng = Random.GLOBAL_R
guidefontsize = 14,
tickfontsize = 12,
legendfontsize = 12,
)
)

# We will observe properties of the signal that inform us about the amplitude and vertical
# position. These properties will be the range (the difference between the maximum and the minimum),
Expand Down

0 comments on commit fe4daee

Please sign in to comment.