|
| 1 | +clear all; clc; |
| 2 | +% In this example, we use a Douglas-Rachford splitting (DRS) |
| 3 | +% method for solving a monotone inclusion problem |
| 4 | +% find x st 0 \in Ax + Bx |
| 5 | +% where A is L-Lipschitz and monotone and B is (maximally) mu-strongly |
| 6 | +% monotone. We denote by JA and JB the respective resolvents of A and B. |
| 7 | +% |
| 8 | +% One iteration of the algorithm starting from point w is as follows: |
| 9 | +% x = JB( w ) |
| 10 | +% y = JA( 2 * x - w ) |
| 11 | +% z = w - theta * ( x - y ) |
| 12 | +% and then we choose as the next iterate the value of z. |
| 13 | +% |
| 14 | +% Given two initial points w0 and w1, we show how to compute the worst-case |
| 15 | +% contraction factor ||z0 - z1||/||w0 - w1|| obtained after doing one |
| 16 | +% iteration of DRS from respectively w0 and w1. |
| 17 | +% Note that we allow the user to choose a stepsize alpha in the resolvent. |
| 18 | +% |
| 19 | +% This setting is studied in |
| 20 | +% (**) Ernest K. Ryu, Adrien B. Taylor, C. Bergeling, and P. Giselsson. |
| 21 | +% "Operator Splitting Performance Estimation: Tight contraction |
| 22 | +% factors and optimal parameter selection." arXiv:1812.00146, 2018. |
| 23 | +% |
| 24 | +% (0) Initialize an empty PEP |
| 25 | +P=pep(); |
| 26 | + |
| 27 | +% (1) Set up the class of monotone inclusions |
| 28 | +paramA.L = 1; paramA.mu = 0; % A is 1-Lipschitz and 0-strongly monotone |
| 29 | +paramB.mu = .1; % B is .1-strongly monotone |
| 30 | + |
| 31 | +A = P.DeclareFunction('LipschitzStronglyMonotone',paramA); |
| 32 | +B = P.DeclareFunction('StronglyMonotone',paramB); |
| 33 | + |
| 34 | +% (2) Set up the starting points |
| 35 | +w0=P.StartingPoint(); |
| 36 | +w1=P.StartingPoint(); |
| 37 | +P.InitialCondition((w0-w1)^2<=1); % Normalize the initial distance ||w0-ws||^2 <= 1 |
| 38 | + |
| 39 | +% (3) Algorithm |
| 40 | +alpha = 1.3; % step size (in the resolvents) |
| 41 | +theta = .9; % overrelaxation |
| 42 | + |
| 43 | +x0 = proximal_step(w0,B,alpha); |
| 44 | +y0 = proximal_step(2*x0-w0,A,alpha); |
| 45 | +z0 = w0-theta*(x0-y0); |
| 46 | + |
| 47 | +x1 = proximal_step(w1,B,alpha); |
| 48 | +y1 = proximal_step(2*x1-w1,A,alpha); |
| 49 | +z1 = w1-theta*(x1-y1); |
| 50 | + |
| 51 | +% (4) Set up the performance measure: ||z0-z1||^2 |
| 52 | +P.PerformanceMetric((z0-z1)^2); |
| 53 | + |
| 54 | +% (5) Solve the PEP |
| 55 | +P.solve() |
| 56 | + |
| 57 | +% (6) Evaluate the output |
| 58 | +double((z0-z1)^2) % worst-case contraction factor |
| 59 | + |
| 60 | +% Results to be compared with WC below (from (**)): |
| 61 | +L = alpha*paramA.L; mu = alpha*paramB.mu; |
| 62 | +C = sqrt(((2*(theta-1)*mu+theta-2)^2+L^2*(theta-2*(mu+1))^2)/(L^2+1)); |
| 63 | +if theta*(theta+C)/(mu+1)^2/C * (C+mu*((2*(theta-1)*mu+theta-2)-L^2*... |
| 64 | + (theta-2*(mu+1)))/(L^2+1)) >=0 |
| 65 | + WC = ((theta+C)/2/(mu+1))^2; |
| 66 | +elseif L<=1 && mu >= (L^2+1)/(L-1)^2 && theta<=-(2*(mu+1)*(L+1)*(mu+... |
| 67 | + (mu-1)*L^2-2*mu*L-1))/(mu+L*(L^2+L+1)+2*mu^2*(L-1)+mu*L*(1-(L-3)*L)+1) |
| 68 | + WC = (1-theta*(L+mu)/(L+1)/(mu+1))^2; |
| 69 | +else |
| 70 | + WC = (2-theta)/4/mu/(L^2+1) * ... |
| 71 | + (theta*(1-2*mu+L^2)-2*mu*(L^2-1))*... |
| 72 | + (theta*(1+2*mu+L^2)-2*(mu+1)*(L^2+1))/... |
| 73 | + (theta*(1+2*mu-L^2)-2*(mu+1)*(1-L^2)); |
| 74 | +end |
| 75 | +WC |
0 commit comments