Skip to content

Commit

Permalink
scalar_optimize_and_plot_RF.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
odunbar committed Apr 6, 2023
1 parent ecd1eca commit a6e0978
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions examples/Emulator/RandomFeature/scalar_optimize_and_plot_RF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ using CalibrateEmulateSample.ParameterDistributions
case = "scalar"
println("running case $case")

diagonalize_input = true

plot_flag = true
if plot_flag
using Plots
Expand Down Expand Up @@ -75,7 +77,7 @@ if plot_flag
zguidefontrotation = 90,
)

figpath = joinpath(output_directory, "RF_" * case * "_observed_y1nonoise.png")
figpath = joinpath(output_directory, "RF_observed_y1nonoise.png")
savefig(figpath)

p2 = plot(
Expand All @@ -89,7 +91,7 @@ if plot_flag
ylabel = "x2",
zguidefontrotation = 90,
)
figpath = joinpath(output_directory, "RF_" * case * "_observed_y2nonoise.png")
figpath = joinpath(output_directory, "RF_observed_y2nonoise.png")
savefig(figpath)

p3 = plot(
Expand All @@ -103,7 +105,7 @@ if plot_flag
ylabel = "x2",
zguidefontrotation = 90,
)
figpath = joinpath(output_directory, "RF_" * case * "_observed_y1.png")
figpath = joinpath(output_directory, "RF_observed_y1.png")
savefig(figpath)

p4 = plot(
Expand All @@ -117,15 +119,15 @@ if plot_flag
ylabel = "x2",
zguidefontrotation = 90,
)
figpath = joinpath(output_directory, "RF_" * case * "_observed_y2.png")
figpath = joinpath(output_directory, "RF_observed_y2.png")
savefig(figpath)

end

# setup random features
n_features = 200
n_features = 180

srfi = ScalarRandomFeatureInterface(n_features, p)
srfi = ScalarRandomFeatureInterface(n_features, p, diagonalize_input = diagonalize_input)
emulator = Emulator(srfi, iopairs, obs_noise_cov = Σ, normalize_inputs = true)
println("build RF with $n training points and $(n_features) random features.")

Expand Down

0 comments on commit a6e0978

Please sign in to comment.