Repeated Evaluations#
This example performs simulation of the the Bind. The algorithm with parameters \(\lambda, \gamma > 0\) is used to solve a three-operator inclusion problem.
\[\begin{split}\mat{c}{x_{k+1} \hl z^1_k \\ z^2_k \\ z^3_k \\ z^4_k} &=
\mat{c|cccc}{I & -2\gamma \lambda I & -\gamma \lambda I& -2\gamma \lambda I & -\gamma \lambda I \hl
I & -\lambda I & 0 & 0 & 0 \\
I & -\lambda I & 0 & 0 & 0 \\
I & -2\lambda I & -\lambda I & -\lambda I & 0 \\
I & -2 \lambda I & -\lambda I & - \lambda I & 0} \mat{c}{x_k \hl w^1_k \\ w^2_k \\ w^3_k \\ w^4_k}, \quad & \mat{c}{w^1_k \\ w^2_k \\ w^3_k \\ w^4_k} &= \mat{c}{F_1 (z^1_k) \\ F_2 (z^2_k)\\ F_3 (z^3_k) \\ F_2(z^4_k)}\end{split}\]
Operator \(F_2\) is evaluated twice per iteration, at instants 2 and 4. In this simulation, the operators \(F_1\) and \(F_2\) are gradients of quadratics, and \(F_3\) is the subdifferential of an \(L_\infty\) norm indicator function.
Figure 1 plots an algorithm execution with \(\gamma = 0.4, \lambda = 0.25\) starting from a random initial state \(x_0\), for a problem with variable \(\beta \in \R^{200}\).
Figure 1: Algorithm with bind \([1, 2, 3, 2]\)#
Figure 1: Algorithm with bind \([1, 2, 3, 2]\)#
Code for optimization with repeated operator evaluation#
1%simulation of a multi-step algorithm
2rng(40, 'twister');
3d = 200; %dimension of problem
4
5
6
7%% create a multi-step controller that satisfies the regulator equation
8gamma = 0.4; %stepsizes
9lambda = 0.25;
10
11
12A = 1;
13B = -gamma*lambda * [2, 1, 2, 1];
14C = ones(4, 1);
15D = -lambda * [1, 0, 0, 0;
16 1, 0, 0, 0;
17 2, 1, 1, 0;
18 2, 1, 1, 0];
19
20
21K = ss(A, B, C, D, 1);
22
23
24%% form the operators
25
26
27%randomly generate the quadratics
28m1 = 1; m2 = 0;
29L1 = 3; L2 = 6;
30Q1 = rand_quad(d, m1, L1); bstar1 = randn(d, 1)*100 - 20;
31Q2 = rand_quad(d, m2, L2); bstar2 = randn(d, 1)*100 + 20;
32
33BOX = 30; %L infinity norm constraint
34
35%create the operators
36op1 = op_sim_quad(Q1, bstar1);
37op2 = op_sim_quad(Q2, bstar2);
38op3 = op_sim_box(BOX);
39ops = {op1, op2, op3};
40
41%put the system together
42bind = [1, 2, 3, 2]; %assign the ordering of operators
43sys = opt_system(ops, [], K, bind);
44
45%% simulate and plot
46sim = alg_sim(sys, d);
47% T = 200;
48T = 100;
49sim.sampler.x0 = 200*randn(1, d);
50sim_out= sim.sim(T);
51plt = alg_plotter(sim_out);
52fig1 = plt.plot_4(1);
53
54zend = sim_out.z(:, :, end);