Commit 7d39028b authored by alexander.dornheim's avatar alexander.dornheim
Browse files

Continued on CDP_processor. Not yet done.

parent ab17984e
......@@ -51,38 +51,36 @@ def CDP_processor(config):
end
# Data
Y = abs(A(x));
config['rt_data=Y;
Y=Y.^2;
config['data=Y;
config['norm_data=sum(Y(:))/numel(Y);
normest = sqrt(config['norm_data); # Estimate norm to scale eigenvector
config['norm_rt_data=normest;
Y = abs(A(x))
config['rt_data']=Y;
Y=Y**2
config['data']=Y
config['norm_data']=sum(Y(:))/numel(Y)
normest = sqrt(config['norm_data']) # Estimate norm to scale eigenvector
config['norm_rt_data']=normest
## Initialization
npower_iter = config['warmup_iter; # Number of power iterations
npower_iter = config['warmup_iter']; # Number of power iterations
z0 = randn(n1,n2); z0 = z0/norm(z0,'fro'); # Initial guess
tic # Power iterations
for tt = 1:npower_iter
for tt in range(npower_iter):
z0 = At(Y.*A(z0)); z0 = z0/norm(z0,'fro');
end
Times = toc;
Times = toc
z = normest * z0; # Apply scaling
if(n2==1)
if n2==1:
Relerrs = norm(x - exp(-1i*angle(trace(x'*z))) * z, 'fro')/norm(x,'fro');
config['u_0 = repmat(z,1,L);
elseif(n1==1)
config['u_0'] = repmat(z,1,L);
elif n1==1:
Relerrs = norm(x - exp(-1i*angle(trace(z'*x))) * z, 'fro')/norm(x,'fro');
config['u_0 = repmat(z,L,1);
else
config['u_0'] = repmat(z,L,1);
else:
Relerrs = norm(x - exp(-1i*angle(trace(x'*z))) * z, 'fro')/norm(x,'fro');
config['u_0=reshape(repmat(z,[1 L]), size(z,1), size(z,2), L);
end
config['u_0']=reshape(repmat(z,[1 L]), size(z,1), size(z,2), L);
fprintf('Run time of initialization: #.2f\n', Times)
fprintf('Relative error after initialization: #f\n', Relerrs)
fprintf('\n')
end
print('Run time of initialization: #.2f\n', Times)
print('Relative error after initialization: #f\n', Relerrs)
print('\n')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment