GSLS¶
- class GSLS(max_iter=10000, max_eval=10000, disp=False, sampling_radius=1e-06, sample_size_factor=1, initial_step_size=0.01, min_step_size=1e-10, step_size_multiplier=0.4, armijo_parameter=0.1, min_gradient_norm=1e-08, max_failed_rejection_sampling=50)[source]¶
Gaussian-smoothed Line Search.
An implementation of the line search algorithm described in https://arxiv.org/pdf/1905.01332.pdf, using gradient approximation based on Gaussian-smoothed samples on a sphere.
- Parameters
max_iter (
int
) – Maximum number of iterations.max_eval (
int
) – Maximum number of evaluations.disp (
bool
) – Set to True to display convergence messages.sampling_radius (
float
) – Sampling radius to determine gradient estimate.sample_size_factor (
int
) – The size of the sample set at each iteration is this number multiplied by the dimension of the problem, rounded to the nearest integer.initial_step_size (
float
) – Initial step size for the descent algorithm.min_step_size (
float
) – Minimum step size for the descent algorithm.step_size_multiplier (
float
) – Step size reduction after unsuccessful steps, in the interval (0, 1).armijo_parameter (
float
) – Armijo parameter for sufficient decrease criterion, in the interval (0, 1).min_gradient_norm (
float
) – If the gradient norm is below this threshold, the algorithm stops.max_failed_rejection_sampling (
int
) – Maximum number of attempts to sample points within bounds.
Attributes
Returns bounds support level
Returns gradient support level
Returns initial point support level
Returns is bounds ignored
Returns is bounds required
Returns is bounds supported
Returns is gradient ignored
Returns is gradient required
Returns is gradient supported
Returns is initial point ignored
Returns is initial point required
Returns is initial point supported
Return setting
Methods
Return support level dictionary.
GSLS.gradient_approximation
(n, x, x_value, …)Construct gradient approximation from given sample.
GSLS.gradient_num_diff
(x_center, f, epsilon)We compute the gradient with the numeric differentiation in the parallel way, around the point x_center.
GSLS.ls_optimize
(n, obj_fun, initial_point, …)Run the line search optimization.
GSLS.optimize
(num_vars, objective_function)Perform optimization.
Print algorithm-specific options.
GSLS.sample_points
(n, x, num_points)Sample
num_points
points aroundx
on then
-sphere of specified radius.GSLS.sample_set
(n, x, var_lb, var_ub, num_points)Construct sample set of given size.
GSLS.set_max_evals_grouped
(limit)Set max evals grouped
GSLS.set_options
(**kwargs)Sets or updates values in the options dictionary.
GSLS.wrap_function
(function, args)Wrap the function to implicitly inject the args at the call of the function.