Commit a8e50aeb by jansen31

### Merge remote-tracking branch 'origin/dornheim' into dornheim

parents 49e0b8aa 6e0bee00
 ... ... @@ -5,11 +5,13 @@ Created on Mon Dec 14 13:08:06 2015 @author: rebecca """ from math import sqrt from numpy import zeros from math import sqrt, exp from numpy import zeros, angle from numpy import all as a from scipy.linalg import norm from .algorithms import Algorithm class AP_expert(Algorithm): """ Alternating Projections ... ... @@ -54,6 +56,7 @@ class AP_expert(Algorithm): self.truth = config['truth'] self.truth_dim = config['truth_dim'] self.norm_truth = config['norm_truth'] def run(self, u, tol, maxiter): """ ... ... @@ -91,18 +94,18 @@ class AP_expert(Algorithm): tmp1 = prox2.work(tmp_u); tmp_change = 0; tmp_gap = 0; if p==1 and q==1: tmp_change= (norm(u-tmp_u, 'fro')/norm_data)**2 tmp_gap = (norm(tmp1-tmp_u,'fro')/norm_data)**2 if hasattr(self, 'truth'): if self.truth_dim[0] == 1: z=tmp_u[0,:] elif self.truth_dim[1]==1: z=tmp_u[:,0] else: z=tmp_u Relerrs[iter] = norm(self.truth - exp(-1j*angle(trace(self.truth.T*z))) * z, 'fro')/self.norm_truth Relerrs[iter] = norm(self.truth - exp(-1j*angle(trace(self.truth.T*z))) * z, 'fro')/self.norm_truth elif q==1: for j in range(self.product_space_dimension): ... ...