资源简介
贝叶斯压缩感知和分布式贝叶斯压缩感知的算法实现,很好的范例
代码片段和文件信息
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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2664 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\README.txt
文件 60236 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\approx_results.mat
文件 5463 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\BCS_fast_rvm.m
文件 2096 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\Fig2.m
文件 1262 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\Fig4_ab.m
文件 3536 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\l1qc_logbarrier.m
文件 4413 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\l1qc_newton.m
文件 1696 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\multi_approx_measures.m
文件 1763 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\multi_optimized_measures.m
文件 1514 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\multi_random_measures.m
文件 60300 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\optimized_results.mat
文件 60084 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\BCS_demo\random_results.mat
文件 955 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\l1dantzig_example.m
文件 644 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\l1decode_example.m
文件 1003 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\l1eq_example.m
文件 1114 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\l1qc_example.m
文件 1448 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\README
文件 1449 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\tvdantzig_example.m
文件 1396 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\tveq_example.m
文件 867 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\tveq_phantom_example.m
文件 1424 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\tvqc_example.m
文件 1405 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\tvqc_quantization_example.m
文件 65728 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\Data\boats.mat
文件 65728 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\Data\camera.mat
文件 543 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\Data\RandomStates.mat
文件 718 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\Measurements\At_f.m
文件 613 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\Measurements\At_fhp.m
文件 659 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\Measurements\A_f.m
文件 576 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\Measurements\A_fhp.m
文件 832 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\Measurements\LineMask.m
文件 6601 2020-10-21 13:07 BCS_CODE\bcs_ver0.1\l1magic\Notes\l1magic.bib
............此处省略46个文件信息
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论