资源简介
LLE(MATLAB)
官方源码,附带有案例
代码片段和文件信息
% LLE ALGORITHM (using K nearest neighbors)
%
% [Y] = lle(XKdmax)
%
% X = data as D x N matrix (D = dimensionality N = #points)
% K = number of neighbors
% dmax = max embedding dimensionality
% Y = embedding as dmax x N matrix
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Y] = lle(XKd)
[DN] = size(X);
fprintf(1‘LLE running on %d points in %d dimensions\n‘ND);
% STEP1: COMPUTE PAIRWISE DISTANCES & FIND NEIGHBORS
fprintf(1‘-->Finding %d nearest neighbours.\n‘K);
X2 = sum(X.^21);
distance = repmat(X2N1)+repmat(X2‘1N)-2*X‘*X;
[sortedindex] = sort(distance);
neighborhood = index(2:(1+K):);
% STEP2: SOLVE FOR RECONSTRUCTION WEIGHTS
fprintf(1‘-->Solving for reconstruction weights.\n‘);
if(K>D)
fprintf(1‘ [note: K>D; regularization will be used]\n‘);
tol=1e-3; % regularlizer in case constrained fits are ill conditioned
else
tol=0;
end
W = zeros(KN);
for ii=1:N
z = X(:neighborhood(:ii))-repmat(X(:ii)1K); % shift ith pt to origin
C = z‘*z; % local covariance
C = C + eye(KK)*tol*trace(C); % regularlization (K>D)
W(:ii) = C\ones(K1); % solve Cw=1
W(:ii) = W(:ii)/sum(W(:ii)); % enforce sum(w)=1
end;
% STEP 3: COMPUTE embedDING FROM EIGENVECTS OF COST MATRIX M=(I-W)‘(I-W)
fprintf(1‘-->Computing embedding.\n‘);
% M=eye(NN); % use a sparse matrix with storage for 4KN nonzero elements
M = sparse(1:N1:Nones(1N)NN4*K*N);
for ii=1:N
w = W(:ii);
jj = neighborhood(:ii);
M(iijj) = M(iijj) - w‘;
M(jjii) = M(jjii) - w;
M(jjjj) = M(jjjj) + w*w‘;
end;
% CALCULATION OF embedDING
options.disp = 0; options.isreal = 1; options.issym = 1;
[Yeigenvals] = eigs(Md+10options);
Y = Y(:2:d+1)‘*sqrt(N); % bottom evect is [1111...] with eval 0
fprintf(1‘Done.\n‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% other possible regularizers for K>D
% C = C + tol*diag(diag(C)); % regularlization
% C = C + eye(KK)*tol*trace(C)*K; % regularlization
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2140 2014-02-03 10:09 LLE\lle.m
文件 1305 2014-02-03 10:09 LLE\scurve.m
文件 1213 2014-02-03 10:09 LLE\swissroll.m
目录 0 2014-02-03 10:11 LLE
----------- --------- ---------- ----- ----
4658 4
相关资源
- Isomapmatlab,官方源代码
- crf条件随机场模型--matlab源码
- Matlab余弦相似度算法判断图片相似度
- 率失真函数计算matlab程序-信息论
- SISO系统的多径瑞利信道理想信道估计
- 空间调制天线选择的程序
- sigama 自适应高斯滤波器 matlab 程序
- 概率数据关联算法matlab程序
- 神经网络滑模控制器设计的matlab源代
- DTMF双音多频信号生成与检测Matlab
- 关于肤色分割的matlab源代码
- 电力系统状态估计MATLAB算法
- 基于卡尔曼滤波理论设计的航母甲板
- matlab tsp问题代码
- 快速Fourier变换算法及Matlab程序实现
- 基于matlab的数字图像的频域滤波器设
- TDOA时差定位算法仿真
- matlab2015b破解文件
- lasso经典matlab源码
- 经典卡尔曼滤波 目标跟踪 matlab 程序
- Gabor变换实现(CmatlabOpenCV)
- 图像像素级融合 matlab
- 应用MATLAB实现探地雷达数据小波变换
- 两幅图像的互信息的matlab代码
- MATLAB处理心电图的噪声
- Matlab-EMD工具箱 + 详细安装方法
- Random Walk (随机游走) matlab
- Delta机器人正逆解
- MATLAB与机器学习详细.txt
- matlab2011b找不到编译器vs2012的问题
评论
共有 条评论