AdaptiveStepLandweberHyperplane#
- class AdaptiveStepLandweberHyperplane(A, b, relaxation=1.0, weights=None, proximity_flag=True)[source]#
Bases:
SimultaneousKaczmarzMethodLandweber algorithm with adaptive step size for solving linear equalities of the form Ax = b.
- Parameters:
A (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]] |sparray) – Matrix for linear systemsb (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – Bound for linear systemsrelaxation (
float) – The outer relaxation parameter, by default 1.0.weights (
Union[None,List[float],ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]]) – The weights for the constraints, by default None.proximity_flag (
bool) – Flag to indicate if proximity calculations should be performed, by default True.
Methods
indexed_map(x, idx)Applies the linear mapping to the input array x at multiple specified indices.
map(x)Applies the linear mapping to the input array x.
project(x)Perform the (possibly relaxed) projection of input array 'x' onto the constraint.
proximity(x, proximity_measures)Calculate proximity measures of point x to the set.
single_map(x, i)Applies the linear mapping to the input array x at a specific index i.
solve(x[, max_iter, prox_tol, del_prox_tol, ...])Solves the optimization problem using an iterative approach.
step(x)Perform the (possibly relaxed) projection of input array 'x' onto the constraint.
References
- indexed_map(x, idx)#
Applies the linear mapping to the input array x at multiple specified indices.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – The input array to which the linear mapping is applied.idx (
Union[List[int],ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]]) – The indices at which the linear mapping is applied.
- Return type:
ndarray- Returns:
The result of applying the linear mapping to the input array at the specified indices.
- map(x)#
Applies the linear mapping to the input array x.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – The input array to which the linear mapping is applied.- Return type:
ndarray- Returns:
The result of applying the linear mapping to the input array.
- project(x)#
Perform the (possibly relaxed) projection of input array ‘x’ onto the constraint.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – The input array to be projected.- Return type:
ndarray- Returns:
The (possibly relaxed) projection of ‘x’ onto the constraint.
- proximity(x, proximity_measures)#
Calculate proximity measures of point x to the set.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – Input array for which the proximity measure is to be calculated.- Return type:
float- Returns:
The proximity measures of the input array x.
- single_map(x, i)#
Applies the linear mapping to the input array x at a specific index i.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – The input array to which the linear mapping is applied.i (
int) – The specific index at which the linear mapping is applied.
- Return type:
ndarray- Returns:
The result of applying the linear mapping to the input array at the specified index.
- solve(x, max_iter=500, prox_tol=1e-06, del_prox_tol=1e-08, del_prox_n=5, storage=False, storage_iters=None, proximity_measures=None, alternative_stopping_criterion=None, alternative_stopping_criterion_initial_call=None)#
Solves the optimization problem using an iterative approach.
- 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.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 solution after the iterative process.
- step(x)#
Perform the (possibly relaxed) projection of input array ‘x’ onto the constraint.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – The input array to be projected.- Return type:
ndarray- Returns:
The (possibly relaxed) projection of ‘x’ onto the constraint.