Superiorization#
- class Superiorization(basic, perturbation_scheme)[source]#
Bases:
FeasibilityPerturbationSuperiorization algorithm for constrained optimization problems.
- Parameters:
basic (
Projection) – The underlying feasibility seeking algorithm.perturbation_scheme (
Perturbation) – The perturbation scheme to be used for superiorization.
- Attributes:
- basicCallable
The underlying feasibility seeking algorithm.
- perturbation_schemePerturbation
The perturbation scheme to be used for superiorization.
- objective_tolfloat
Tolerance for the objective function value change to determine stopping criteria.
- prox_tolfloat
Tolerance for the constraint proximity value change to determine stopping criteria.
- _kint
The current iteration number.
- all_xlist | None
List of all points achieved during the optimization process, only stored if requested by the user.
- all_function_valueslist | None
List of all objective function values achieved during the optimization process, only stored if requested by the user.
- all_x_function_reductionlist | None
List of all points achieved via the function reduction step, only stored if requested by the user.
- all_function_values_function_reductionlist | None
List of all objective function values achieved via the function reduction step, only stored if requested by the user.
- all_x_basiclist | None
List of all points achieved via the basic feasibility seeking algorithm, only stored if requested by the user.
- all_function_values_basiclist | None
List of all objective function values achieved via the basic feasibility seeking algorithm, only stored if requested by the user.
Methods
solve(x_0[, max_iter, prox_tol, ...])Solve the optimization problem using the superiorization method.
storage(x, kind[, storage, f, p])Stores the given values of x and f into the corresponding lists.
- solve(x_0, max_iter=10, prox_tol=1e-06, del_prox_tol=1e-08, del_prox_n=5, del_objective_tol=1e-06, del_objective_n=5, proximity_measures=None, storage=False, storage_iters=None, alternative_stopping_criterion=None, alternative_stopping_criterion_initial_call=None)[source]#
Solve the optimization problem using the superiorization method.
- Parameters:
x_0 (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – Initial guess for the solution.max_iter (
int) – Maximum number of iterations to perform (default is 10).prox_tol (
float) – Tolerance for the constraint function value to determine stopping criteria, by default 1e-6.del_prox_tol (
float) – Tolerance for the proximity function value change to determine stopping criteria, by default 1e-8.del_prox_n (
int) – Number of iterations with proximity changes below the threshold to determine stopping criteria, by default 5.proximity_measures (
Optional[List]) – The proximity measures to calculate, by default None. Right now only the first in the list is used to check the feasibility.del_objective_tol (
float) – Tolernace for the objective function value to determine stopping criteria, by default 1e-6.del_objective_n (
int) – Number of iterations with objective function changes below the threshold to determine stopping criteria, by default 5.storage (
bool) – If True, store intermediate results (default is False).storage_iters (
Union[List[int],int,None]) – Controls which iterations are stored (when storage=True). If None, all iterations are stored. If a list of ints, only those iteration indices are stored (0 = initial point). If an int, storage occurs every that many iterations.alternative_stopping_criterion (
Optional[Callable]) – Alternative stopping criterionalternative_stopping_criterion_initial_call (
Optional[Callable]) – Initial call for an alternative stopping criterion
- Return type:
ndarray- Returns:
The superiorized solution.
- storage(x, kind, storage=True, f=None, p=None)[source]#
Stores the given values of x and f into the corresponding lists.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – The current value of the variable x to be stored.kind (
str) – The type of storage to be used, either “function_reduction” or “basic”.storage (
bool) – If True, store the values of x