// Random search
dummy_res = run_measure( "random", n_random_starts)
lhs_res = run_measure("lhs", n_random_starts,
{"lhs_type": "classic",
"criterion": None})
lhs2_res = run_measure("lhs", n_random_starts,
{"criterion": "maximin"})sobol_res = run_measure("sobol", n_random_starts,
{"randomize": False,
"min_skip": 1, "max_skip": 100})
halton_res = run_measure("halton", n_random_starts)
hammersly_res = run_measure("hammersly", n_random_starts)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Note that this can take a few minutes.
plot = plot_convergence([("random", dummy_res),
("lhs", lhs_res),
("lhs_maximin", lhs2_res),
("sobol", sobol_res),
("halton", halton_res),
("hammersly", hammersly_res)],
true_minimum=true_minimum,
yscale=yscale,
title=title)
plt.show()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This plot shows the value of the minimum found (y axis) as a function
// of the number of iterations performed so far (x axis). The dashed red line
// indicates the true value of the minimum of the :class:`benchmarks.hart6`
// function.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Test with different n_random_starts values
lhs2_15_res = run_measure("lhs", 12,
{"criterion": "maximin"})
lhs2_20_res = run_measure("lhs", 14,
{"criterion": "maximin"})
lhs2_25_res = run_measure("lhs", 16,
{"criterion": "maximin"})
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// n_random_starts = 10 produces the best results
After Change
sobol_res = run_measure(sobol, n_initial_points)
halton_res = run_measure("halton", n_initial_points)
hammersly_res = run_measure("hammersly", n_initial_points)
grid_res = run_measure("grid", n_initial_points)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Note that this can take a few minutes.
plot = plot_convergence([("random", dummy_res),
("lhs", lhs_res),
("lhs_maximin", lhs2_res),
("sobol", sobol_res),
("halton", halton_res),
("hammersly", hammersly_res),
("grid", grid_res)],
true_minimum=true_minimum,
yscale=yscale,
title=title)