Skip to main content
. 2013 Nov 6;13(11):15172–15186. doi: 10.3390/s131115172

Algorithm 1: The Multi-Matrices Factorization Algorithm.

Input: matrix R; number of the latent features, d; learning rates, η1, η2, η3 and η4; regularization parameters, α and λ; threshold ϵ.
Output: the estimated matrix, R̂.
// Initialize U and V.
1 Draw random vectors, U(1),1, U(1),2, …, U(1),n, V1 ∼ N(0, I);
2 for j = 2; j ≤ t; j + + do
3  Let Vj = Vj−1 + Z; here Z ∼ Laplace(0, 1);
4 end
5 for j = 2; j ≤ t; j + + do
6  for i = 1; i ≤ n; i + + do
7   Let U(j),i = U(j-1),i + Z; here Z ∼ Laplace(0, 1);
8  end
9 end
// Coordinate descent.
10 W1=∑i=1n∑j=1t(Ri,j−U(j),iTVj)2I(Ri,j≠′⊥′)+α∑j=1t‖U(j),1‖22+β‖V1‖22+γ∑i=1n∑j=2t‖U(j),i−U(j−1),i‖1+λ∑j=2t‖Vj−Vj−1‖1;
11
12 W2 = inf;
13 while |W2 – W1| > ϵ do
14  W2 = W1;
15  for i= 1, 2 …, n do
16   Let U(1),inew=U(1),i−η1∂W1∂U(1),i;
17  end
18  for j > 1 and i = 1, 2 …, n do
19   Let U(j),inew=U(j),i−η2∂W1∂U(j),i
20  end
21   V1new=V1−η3∂W1∂V1;
22  for j = 2 …, t do
23   Let Vjnew=Vj−η4∂W1∂Vj;
24  end
25  Replace all U(j),is with U(j),inews and Vjs with Vjnews, recompute W1;
26 end
27 return R̂, where R^j=U(j)TVj;