SplitSuperiorization#
- class SplitSuperiorization(basic, input_perturbation_scheme=None, target_perturbation_scheme=None)[source]#
Bases:
FeasibilityPerturbationA class used to perform split superiorization on a given feasibility problem.
- Parameters:
basic (object) – An instance of a split problem.
input_perturbation_scheme (
Perturbation|None) – Perturbation scheme for the input, by default None.target_perturbation_scheme (
Perturbation|None) – Perturbation scheme for the target, by default None.input_objective_tol (float, optional) – Tolerance for the input objective function, by default 1e-4.
target_objective_tol (float, optional) – Tolerance for the target objective function, by default 1e-4.
prox_tol (float, optional) – Tolerance for the constraint, by default 1e-6.
- Attributes:
- input_perturbation_schemePerturbation or None
Perturbation scheme for the input.
- target_perturbation_schemePerturbation or None
Perturbation scheme for the target.
- input_objective_tolfloat
Tolerance for the input objective function.
- target_objective_tolfloat
Tolerance for the target objective function.
- prox_tolfloat
Tolerance for the constraint.
- input_f_kfloat
The current objective function value for the input.
- target_f_kfloat
The current objective function value for the target.
- p_kfloat
The current proximity function value.
- _kint
The current iteration number.
- all_x_valueslist
Array storing all points achieved via the superiorization algorithm.
- all_function_valueslist
Array storing all objective function values achieved via the superiorization algorithm.
- all_x_values_function_reductionlist
Array storing all points achieved via the function reduction step.
- all_function_values_function_reductionlist
Array storing all objective function values achieved via the function reduction step.
Methods
solve(x[, max_iter, prox_tol, del_prox_tol, ...])Solves 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, max_iter=10, prox_tol=1e-06, del_prox_tol=1e-08, del_prox_n=5, proximity_measures=None, del_input_objective_tol=1e-06, del_input_objective_n=5, del_target_objective_tol=1e-06, del_target_objective_n=5, storage=False, storage_iters=None, alternative_stopping_criterion=None, alternative_stopping_criterion_initial_call=None)[source]#
Solves the optimization problem using the superiorization method.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – Starting point for the algorithm.max_iter (
int) – Maximum number of iterations to perform, by default 500.prox_tol (
float) – The tolerance for the proximity on the constraints, by default 1e-6.del_prox_tol (
float) – The tolerance for the change in proximity over the last del_prox_n iterations, by default 1e-8.del_prox_n (
int) – The number of iterations that del_prox_tol needs to be met in a row, by default 5.proximity_measures (
Optional[List]) – The proximity measures to calculate, by default a l2 norm measure is used. Right now only the first in the list is used to check the feasibility.del_input_objective_tol (
float) – The tolerance for change in the objective function over the last del_input_objective_n iterations, by default 1e-8.del_input_objective_n (
int) – The number of iterations that del_input_objective_tol needs to be met in a row, by default 5.del_target_objective_tol (
float) – The tolerance for change in the objective function over the last del_target_objective_n iterations, by default 1e-8.del_target_objective_n (
int) – The number of iterations that del_target_objective_tol needs to be met in a row, by default 5.storage (
bool) – Flag indicating whether to store intermediate solutions, by default 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 after performing the superiorization method.
- 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