资源简介
来自Duke大学官网的贝叶斯压缩感知matlab函数包,亲测可用。 居家旅行必备!研究压缩感知必备!
代码片段和文件信息
function [weightsusedsigma2errbarsbasis] = BCS_fast_rvm(PHItsigma2etaadaptiveoptimalscale)
%------------------------------------------------------------------
% The BCS algorithm for the following paper:
% “Bayesian Compressive Sesning“ (Preprint 2007). The algorithm
% adopts from the fast RVM algorithm [Tipping & Faul 2003].
% Coded by: Shihao Ji ECE Duke University
% last change: Jan. 2 2007
% You are suggested to use mt_CS.m for improved robustness
%------------------------------------------------------------------
% Input for BCS:
% PHI: projection matrix
% t: CS measurements
% sigma2: initial noise variance
% If measurement noise exists and/or w is not truely sparse
% then sigma2 = std(t)^2/1e2 (suggested)
% If no measurement noise and w is truely sparse
% then sigma2 = std(t)^2/1e6 (suggested)
% This term is in fact not updated in the implementation to allow
% the fast algorithm. For this reason you are recommended to use
% mt_CS.m in which the noise variance is marginalized.
% eta: threshold for stopping the algorithm (suggested value: 1e-8)
% Input for Adaptive CS:
% adaptive: generate basis for adpative CS? (default: 0)
% optimal: use the rigorous implementation of adaptive CS? (default: 1)
% scale: diagonal loading parameter (default: 0.1)
% Output:
% weights: sparse weights
% used: the positions of sparse weights
% sigma2: re-estimated noise variance
% errbars: one standard deviation around the sparse weights
% basis: if adaptive==1 then basis = the next projection vector
%
if nargin < 5
adaptive = 0;
end
if nargin < 6
optimal = 1;
end
if nargin < 7
scale = 0.1;
end
% find initial alpha
[NM] = size(PHI);
PHIt = PHI‘*t;
PHI2 = sum(PHI.^2)‘;
ratio = (PHIt.^2)./PHI2;
[maxrindex] = max(ratio);
alpha = PHI2(index)/(maxr-sigma2);
% compute initial mu Sig S Q
phi = PHI(:index);
Hessian = alpha + phi‘*phi/sigma2;
Sig = 1/Hessian;
mu = Sig*PHIt(index)/sigma2;
left = PHI‘*phi/sigma2;
S = PHI2/sigma2-Sig*left.^2;
Q = PHIt/sigma2-Sig*PHIt(index)/sigma2*left;
%
for count = 1:10000
s = S; q = Q;
s(index) = alpha.*S(index)./(alpha-S(index));
q(index) = alpha.*Q(index)./(alpha-S(index));
theta = q.^2-s;
% choice the next alpha that maximizes marginal likelihood
ml = -inf*ones(1M);
ig0 = find(theta>0);
% index for re-estimate
[irefoowhich] = intersect(ig0index);
if ~isempty(ire)
Alpha = s(ire).^2./theta(ire);
delta = (alpha(which)-Alpha)./(Alpha.*alpha(which));
ml(ire) = Q(ire).^2.*delta./(S(ire).*delta+1)-log(1+S(ire).*delta);
end
% index for adding
iad = setdiff(ig0ire);
if ~isempty(iad)
ml(iad) = (Q(iad).^2-S(iad))./S(iad)+log(S(iad)./(Q(iad).^2));
end
is0 = setdiff([1:M]ig0);
% index for deleting
[idefoowhich] = intersect(is0inde
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2007-07-12 13:23 bcs_ver0.1\BCS_demo\
文件 60254 2007-07-11 10:44 bcs_ver0.1\BCS_demo\approx_results.mat
文件 5463 2007-07-12 13:22 bcs_ver0.1\BCS_demo\BCS_fast_rvm.m
文件 2096 2007-07-11 10:31 bcs_ver0.1\BCS_demo\Fig2.m
文件 1259 2007-07-11 10:31 bcs_ver0.1\BCS_demo\Fig4_ab.m
文件 1696 2007-07-11 10:31 bcs_ver0.1\BCS_demo\multi_approx_measures.m
文件 1763 2007-07-11 10:31 bcs_ver0.1\BCS_demo\multi_optimized_measures.m
文件 1514 2007-07-11 10:31 bcs_ver0.1\BCS_demo\multi_random_measures.m
文件 60300 2007-07-11 10:48 bcs_ver0.1\BCS_demo\optimized_results.mat
文件 60084 2007-07-11 10:49 bcs_ver0.1\BCS_demo\random_results.mat
目录 0 2008-08-17 16:52 bcs_ver0.1\MT_CS_demo\
文件 2662 2007-07-11 10:45 bcs_ver0.1\MT_CS_demo\Fig2.m
文件 1899 2007-07-11 10:45 bcs_ver0.1\MT_CS_demo\Fig3.m
文件 6377 2008-08-17 16:52 bcs_ver0.1\MT_CS_demo\mt_CS.m
文件 299828 2007-07-11 13:02 bcs_ver0.1\MT_CS_demo\multi_results_25.mat
文件 299942 2007-07-11 12:38 bcs_ver0.1\MT_CS_demo\multi_results_50.mat
文件 300077 2007-07-11 12:20 bcs_ver0.1\MT_CS_demo\multi_results_75.mat
文件 2569 2007-07-11 10:45 bcs_ver0.1\MT_CS_demo\multi_runs_25.m
文件 2602 2007-07-11 10:45 bcs_ver0.1\MT_CS_demo\multi_runs_50.m
文件 2602 2007-07-11 10:45 bcs_ver0.1\MT_CS_demo\multi_runs_75.m
文件 2664 2008-08-17 16:50 bcs_ver0.1\README.txt
目录 0 2008-08-17 16:16 bcs_ver0.1\
- 上一篇:数学建模matlab程序附集
- 下一篇:有效的CDD图像修复matlab程序
相关资源
- 基于压缩感知的分布式视频编码框架
- MATLAB工具箱robotics toolbox 9.10
- Wheeled Mobile Robotics From Fundamentals Towa
- Orbital Mechanics for Engineering Students Thi
- 压缩感知磁共振成像
- Multiphysics Modeling Using COMSOL5 and MATLAB书
- matlab2016B robotics toolbox
- 机器人工具箱 Matlab 最新版,Robotics
- 压缩感知CS最全matlab程序,二维三维图
- 机器人学导论课后答案及参考书籍R
- Matlab计量经济学工具箱官方英文手册
- matlab econometrics toolbox
- CSAPP深入理解计算机系统 Kindle版本
- simmechanics学习教程——matlab2015a
- 斯坦福大学CS229机器学习完整详细笔记
-
BLDCsimuli
nk模型 - Introduction to Robotics - Mechanics and Contr
- 斯坦福机器学习公开课CS229讲义作业及
- MATLAB机器人工具箱Matlab_Robotic_Toolbox
- ILnumerics资料
- Robotics Toolbox 10.3.1 matlab机器人工具箱
- Robotics Toolbox for MATLAB10.3.1
- robot-9.10.zip工具箱
- Matlab Robotics Toolbox 9.10软件以及说明书
- _Robotics_Vision_and_Control. 2017
- bregman信号恢复算法
- plecs电力电子仿真软件独立安装包 含
- Machine Vision Toolbox
- Robotics Vision and Control (Fundamental Alg
- kuaisu稀疏贝叶斯
评论
共有 条评论