comparison toolboxes/distance_learning/mlr/thresh/threshFull_admmMixed.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function result = threshFull_admmMixed(R,lam);
2 % return argmin_V lam*||V||_2,1 + 0.5 ||V - A||_F^2
3 % symmetry constraint on V
4
5
6
7 W = R;
8 V = eye(length(R));
9 U = zeros(size(R));
10 q = 1;
11 mu = 100;
12 mult = 2;
13
14 p = numel(R);
15 n = numel(U);
16 tol = 1e-4;
17 ptol = tol * sqrt(p);
18 dtol = tol * sqrt(n);
19
20 iter = 0;
21 while 1
22 iter = iter + 1;
23 Vold = V;
24 W = threshFull_mixed(((1*R+q*(V-U))/(1+q)),lam/(1+q));
25 V = feasible_symm(W+U);
26 U = U + W - V;
27
28 pr = q * norm( V(:)-Vold(:));
29 dr = norm((W(:) - V(:)));
30
31 if pr < ptol && dr < dtol,break,end
32
33 if pr/dr > mu
34 q = 1/mult * q;
35 U = mult * U;
36 % disp(['q = ' num2str(q)]);
37 elseif dr/pr > mu
38 q = mult * q;
39 U = 1/mult * U;
40 % disp(['q = ' num2str(q)]);
41
42 end
43 end
44 %disp(['Iterations: ' num2str(iter)]);
45 %disp(['PR: ' num2str(pr) 'DR: ' num2str(dr)])
46 result = V;
47 end
48
49
50
51 function result = feasible_symm(A)
52 result = 0.5*(A+A');
53 end
54
55