The STOP toolbox is designed for optimization problems on the Stiefel manifold, which could be expressed as
where
can be regarded as a Riemannian manifold in
This toolbox is an integration of several state-of-the-art solvers for optimization problems on the Stiefel manifold. STOP is a prototyping toolbox, designed by capturing the special structures of problems on the Stiefel manifold. For basic use, one only needs to describe the cost function and its derivatives and call the build-in solvers. Basically, all the options in STOP toolbox have default values, and one can execute a solver without any specified option. This toolbox is under maintenance and working in progress. Any feedbacks and contributions are welcome!
The STOP toolbox can be downloaded from Gitee. The current version of STOP is STOPv0.1 and was packaged on 2021/10/12. The STOP toolbox supports two different ways of installation. One could directly copy the solvers to the working folder for temporary execution. Besides, One can also install STOP to Matlab by the following steps.
STOP.zip
file to the installation folder, say /my_install_folder/
./my_install_folder/
folder and execute /my_install_folder/STOP/install_stop.m
in Matlab. If you wish to save the path for future usage, you can use the savepath
function to save the path to STOP solvers.
You can execute the script /my_install_folder/STOP/check_install/checkinstall.m
to check whether STOP is properly installed. This script provides a overall check for all the solvers in STOP toolbox. If there are no errors, you are done! Otherwise, please feel free to contact us.
In this section, we consider the following nonlinear eigenvalue problem
where
In this example, we choose L = gallery('tridiag',n,-1,2,-1)
. Noting that
Solving this optimization problem using solvers in STOP requires little Matlab codes:
321% Problem setting
2n = 1000; p = 10;
3L = gallery('tridiag',n,-1,2,-1);
4alpha = 1;
5[Ll,Lu] = lu(L);
6
7
8% Set options
9opts = []; % no predefined parameter
10opts.X = [];
11opts.dim = [n,p]; %specify dimension
12
13% Solve
14t1 = tic;
15[Out] = SLPG(@myfun,opts,L, Ll,Lu,alpha);
16t=toc(t1)
17
18% Plot
19pic = semilogy(1:Out.iter, Out.kkts,'.-', 1:Out.iter, Out.feas,'*-');
20xlabel('Number of iterations')
21legend('Substationarity','Feasibility')
22
23
24% Define objective function
25function [funX, F] = myfun(X, L, Ll,Lu,alpha)
26 LX = L*X;
27 rhoX = sum(X.^2, 2);
28 tempa = Lu\(Ll\rhoX);
29 tempa = alpha*tempa;
30 F = LX + bsxfun(@times,tempa,X);
31 funX = 0.5*sum(sum(X.*(LX))) + 1/4*(rhoX'*tempa);
32end
Let us review the codes step by step. First, we generate the data (matrix
41n = 1000; p = 10;
2L = gallery('tridiag',n,-1,2,-1);
3alpha = 1;
4[Ll,Lu] = lu(L);
Here instead of directly computing Lu\(Ll\rho)
to compute
Then we specify the cost function and its gradient in the following function.
91% Define objective function
2function [funX, F] = myfun(X, L, Ll,Lu,alpha)
3 LX = L*X;
4 rhoX = sum(X.^2, 2);
5 tempa = Lu\(Ll\rhoX);
6 tempa = alpha*tempa;
7 F = LX + bsxfun(@times,tempa,X);
8 funX = 0.5*sum(sum(X.*(LX))) + 1/4*(rhoX'*tempa);
9end
Currently, in STOP toolbox, we require the function return the function value and its gradient simultaneously. Usually, computing the function value and gradient simultaneously is much faster than compute them separately, even when cache techniques are involved. To achieve a better performance, we strongly suggest to compute the function value and gradient in a single function.
Now, with cost function and the data, we can set options for the solver. The initial point or dimensions should be specified in opts
,
31opts = []; % no predefined parameter
2opts.X = [];
3opts.dim = [n,p]; %specify dimension
Then we call a solver, for instance, SLPG to solve the nonlinear eigenvalue problem.
31t1 = tic;
2[Out] = SLPG(@myfun,opts,L,Ll,Lu,alpha);
3t = toc(t1)
Here the cost function and its derivatives are called by function handles.
Finally, we access the contents of the output structure Out
and display the convergence plot of our solver.
31pic = semilogy(1:Out.iter, Out.kkts,'.-', 1:Out.iter, Out.feas,'*-');
2xlabel('Number of iterations')
3legend('Substationarity','Feasibility')
Solvers, or optimization algorithms, are functions in STOP.
In principle, all solvers admit the basic call format as follows.
11[out] = solver(fun,options);
And we could only specify options.dim
in options
.
The output structure out
contains the final solution to the optimization problem that can be accessed by out.X
. Besides, the output structure out
may contain the information to describe the optimality of the final solution (including the F-norm of Riemannian gradient, function value, and feasibility at the last iterate).
As Stiefel manifold is a nonconvex set in out.X
is not guaranteed to be a global minimizer.
Furthermore, all solvers also admit a more complete call format.
11[out] = solver(fun,options,varargin);
Here the output structure out
may contain information collected in the execution of the solver, including the time, feasibility, substationarity.
The input options options
enables a customized parameters for the provided solver, including the parameters that affects the performance of the solver, the stopping criteria, and the information to be displayed in the execution of the solver.
Name | Comment | Call |
---|---|---|
FOForth | Multiplier correction methods for a specific class of objectives | FOForth(...) |
ProxOrth | Multiplier correction methods for general smooth optimization problems | ProxOrth(...) |
PCAL | ALM-based proximal gradient methods with column-wise normalization | PCAL(...) |
PenCF | First-order method based on exact penalty model (PenC) | PenCF(...) |
PenCPG | First-order method based on exact penalty model for | PenCPG(...) |
SLPG | Penalty-free first-order method for nonsmooth problems | SLPG(...) |
PenCS | Second-order method based on exact penalty model (PenC) | PenCS(...) |