
11-11-2009
|
 | Ăn cơm mèo nói leo các cụ | | Tham gia ngày: Jul 2009
Bài gởi: 72
Thanks: 36 Thanked 14 Times in 12 Posts Downloads: 0 Uploads: 0 | |
Em không hiểu lắm, để em lấy một bài ví dụ mô phỏng của lão Emmanuel Candes ra đây rồi anh nói rõ hơn xem chứ em chả hình dung cách anh làm nó nằm chỗ nào.
Cụ thể cái code của nó đây:
% l1eq_example.m
%
% Test out l1eq code (l1 minimization with equality constraints).
%
% Written by: Justin Romberg, Caltech
% Email: jrom@acm.caltech.edu
% Created: October 2005
%
% put key subdirectories in path if not already there
path(path, './Optimization');
path(path, './Data');
% To reproduce the example in the documentation, uncomment the
% two lines below
load RandomStates
rand('state', rand_state);
randn('state', randn_state);
% signal length
N = 512;
% number of spikes in the signal
T = 20;
% number of observations to make
K = 120;
% random +/- 1 signal
x = zeros(N,1);
q = randperm(N);
x(q(1:T)) = sign(randn(T,1));
% measurement matrix
disp('Creating measurment matrix...');
A = randn(K,N);
A = orth(A')';
disp('Done.');
% observations
y = A*x;
% initial guess = min energy
x0 = A'*y;
% solve the LP
tic
xp = l1eq_pd(x0, A, [], y, 1e-3);
toc
% large scale
Afun = @(z) A*z;
Atfun = @(z) A'*z;
tic
xp = l1eq_pd(x0, Afun, Atfun, y, 1e-3, 30, 1e-8, 200);
toc
Em show kết quả hình ảnh đây cho anh xem 
Từ trái qua phải,trên xuống a,b,c,d. Hình a là tín hiệu x có 20 entries +/-1 với độ dài là 512. Hình b là dùng minimization energy. Hình c là Histogram của Matrix đo A. Hình d là kết quả khôi phục dùng ell-1 linear programming. |