diff --git a/Algorithms/updateV_js.m b/Algorithms/updateV_js.m new file mode 100644 index 0000000..d0d6d45 --- /dev/null +++ b/Algorithms/updateV_js.m @@ -0,0 +1,15 @@ +function Vstar = updateV_js(U1,U2,W,b,rho,gamma,act) + [~,d] = size(W); + I = sparse(eye(d)); + switch act + case 1 + U1 = max(0,U1); % ReLU + case 2 + U1 = tanh_proj(U1); % tanh + case 3 + U1 = sigmoid_proj(U1); % sigmoid + end +% alpha = norm(eta2*(M2'*M2)+eta1*eye(d)); + Vstar = (rho*(W'*W)+gamma*I)\(rho*W'*(U2-b)+gamma*U1); + +end \ No newline at end of file diff --git a/Algorithms/updateWb_js.m b/Algorithms/updateWb_js.m new file mode 100644 index 0000000..b2f7469 --- /dev/null +++ b/Algorithms/updateWb_js.m @@ -0,0 +1,6 @@ +function [Wstar,bstar] = updateWb_js(U,V,W,b,alpha,rho) + [d,N] = size(V); + I = sparse(eye(d)); + Wstar = (alpha*W+rho*(U-b)*V')/(alpha*I+rho*(V*V')); + bstar = (alpha*b+rho*sum(U-W*V,2))/(rho*N+alpha); +end \ No newline at end of file diff --git a/Algorithms/updateWb_js_2.m b/Algorithms/updateWb_js_2.m new file mode 100644 index 0000000..b1a9458 --- /dev/null +++ b/Algorithms/updateWb_js_2.m @@ -0,0 +1,6 @@ +function [Wstar,bstar] = updateWb_js_2(U,V,W,b) + [d,N] = size(V); +% I = sparse(eye(d)); + Wstar = (U-b)*V'*pinv(V*V'); + bstar = sum(U-W*V,2)/N; +end \ No newline at end of file