Update wide vs narrow code

This commit is contained in:
Ksyer
2024-07-22 21:17:57 +08:00
parent 13f660826d
commit 9cbe8e31ea
14 changed files with 1642 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
function [LASSO_lambda, recovery_results] = get_lambda(A, x, FAR_N, FAR_M, sigma, lambdas)
noise = get_noise(sigma, FAR_N, 1);
y = A * x;
y_noise = y + noise;
tau = 1e-6;
iter_max = 1000;
recovery_results = zeros(length(lambdas), 1);
for lambda_idx = 1: length(lambdas)
LASSO_lambda = lambdas(lambda_idx);
[x_LASSO, x_hat_d] = cVAMPro(y_noise, A, LASSO_lambda, tau, iter_max);
recovery_results(lambda_idx) = sum(real(x_LASSO(FAR_M + 1: 2 * FAR_M)));
% if abs(recovery_results(lambda_idx) - FAR_M) / FAR_M < 0.01
% return
% end
end
end