Loading ParallelTVGL.py +9 −1 Changes for ParallelTVGL.py: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -33,6 +33,12 @@ def mp_parallel_tvgl((thetas, z0s, z1s, z2s, u0s, u1s, u2s, thetas_pre = [] final_thetas = {} dimension = np.shape(thetas[0])[0] c = np.zeros((dimension, 3*dimension)) c[:, 0:dimension] = np.eye(dimension) c[:, dimension:2*dimension] = -np.eye(dimension) c[:, 2*dimension:3*dimension] = np.eye(dimension) ct = c.transpose() cc = np.linalg.inv(np.dot(ct, c) + 2*np.eye(3*dimension)) while iteration < MAX_ITER: """ Send last Z2, U2 values to next process, Loading Loading @@ -80,7 +86,9 @@ def mp_parallel_tvgl((thetas, z0s, z1s, z2s, u0s, u1s, u2s, u1s[i-1], u2s[i], beta, rho) rho, ct, cc) else: for i in range(1, n): a = thetas[i] - thetas[i-1] + u2s[i] - u1s[i-1] Loading penalty_functions.py +1 −7 Changes for penalty_functions.py: 1 added line, 7 removed lines. Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ def group_lasso(a, beta, rho): return e def perturbed_node(theta_pre, theta, u1, u2, beta, rho): def perturbed_node(theta_pre, theta, u1, u2, beta, rho, ct, cc): """ Initialize ADMM algorithm """ dimension = np.shape(theta)[0] Loading @@ -50,12 +50,6 @@ def perturbed_node(theta_pre, theta, u1, u2, beta, rho): w = np.ones((dimension, dimension)) uu1 = np.zeros((dimension, dimension)) uu2 = np.zeros((dimension, dimension)) c = np.zeros((dimension, 3*dimension)) c[:, 0:dimension] = np.eye(dimension) c[:, dimension:2*dimension] = -np.eye(dimension) c[:, 2*dimension:3*dimension] = np.eye(dimension) ct = c.transpose() cc = np.linalg.inv(np.dot(ct, c) + 2*np.eye(3*dimension)) """ Run algorithm """ iteration = 0 Loading Loading
ParallelTVGL.py +9 −1 Changes for ParallelTVGL.py: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -33,6 +33,12 @@ def mp_parallel_tvgl((thetas, z0s, z1s, z2s, u0s, u1s, u2s, thetas_pre = [] final_thetas = {} dimension = np.shape(thetas[0])[0] c = np.zeros((dimension, 3*dimension)) c[:, 0:dimension] = np.eye(dimension) c[:, dimension:2*dimension] = -np.eye(dimension) c[:, 2*dimension:3*dimension] = np.eye(dimension) ct = c.transpose() cc = np.linalg.inv(np.dot(ct, c) + 2*np.eye(3*dimension)) while iteration < MAX_ITER: """ Send last Z2, U2 values to next process, Loading Loading @@ -80,7 +86,9 @@ def mp_parallel_tvgl((thetas, z0s, z1s, z2s, u0s, u1s, u2s, u1s[i-1], u2s[i], beta, rho) rho, ct, cc) else: for i in range(1, n): a = thetas[i] - thetas[i-1] + u2s[i] - u1s[i-1] Loading
penalty_functions.py +1 −7 Changes for penalty_functions.py: 1 added line, 7 removed lines. Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ def group_lasso(a, beta, rho): return e def perturbed_node(theta_pre, theta, u1, u2, beta, rho): def perturbed_node(theta_pre, theta, u1, u2, beta, rho, ct, cc): """ Initialize ADMM algorithm """ dimension = np.shape(theta)[0] Loading @@ -50,12 +50,6 @@ def perturbed_node(theta_pre, theta, u1, u2, beta, rho): w = np.ones((dimension, dimension)) uu1 = np.zeros((dimension, dimension)) uu2 = np.zeros((dimension, dimension)) c = np.zeros((dimension, 3*dimension)) c[:, 0:dimension] = np.eye(dimension) c[:, dimension:2*dimension] = -np.eye(dimension) c[:, 2*dimension:3*dimension] = np.eye(dimension) ct = c.transpose() cc = np.linalg.inv(np.dot(ct, c) + 2*np.eye(3*dimension)) """ Run algorithm """ iteration = 0 Loading