• 大小: 7KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-06-07
  • 语言: Matlab
  • 标签: NPE  

资源简介

保持邻域嵌入算法也就是NPE算法的MATLAB代码

资源截图

代码片段和文件信息

function [eigvector eigvalue elapse] = NPE(options data)
% NPE: Neighborhood Preserving embedding
%
%       [eigvector eigvalue elapse] = NPE(options data)

%             Input:
%               data    - Data matrix. Each row vector of data is a data point.
%
%               options - Struct value in Matlab. The fields in options
%                         that can be set:
%
%                      NeighborMode -  Indicates how to construct the graph. Choices
%                           are: 
%                           ‘KNN‘     -  Put an edge between two nodes if and
%                                        only if they are among the k nearst
%                                        neighbors of each other. Default
%                                        option.
%                       ‘Supervised‘  -  Two variations:
%                                       1. k=0 Put an edge between two nodes 
%                                          if and only if they belong to
%                                          same class. 
%                                       2. k>0 The distance between two nodes 
%                                          in the same class will be smaller than 
%                                          two nodes have diff. labels 
%                                          The label information ‘gnd‘ should be
%                                          provided.
%                                              
%                       k           -   The number of neighbors.
%                                       Default k = 5;
%                       gnd         -   The parameter needed under ‘Supervised‘
%                                       NeighborMode.  Colunm vector of the label
%                                       information for each data point.
%
%                         Please see LGE.m for other options.
%
%
%             Output:
%               eigvector - Each column is an embedding function for a new
%                           data point (row vector) x  y = x*eigvector
%                           will be the embedding result of x.
%               eigvalue  - The eigvalue of LPP eigen-problem. sorted from
%                           smallest to largest. 
%               elapse    - Time spent on different steps 

%
%    Examples:
%
%       
%       
%       fea = rand(5070);
%       gnd = [ones(101);ones(151)*2;ones(101)*3;ones(151)*4];
%       options = [];
%       options.k = 5;
%       options.NeighborMode = ‘Supervised‘;
%       options.gnd = gnd;
%       [eigvector eigvalue] = NPE(options fea);
%       Y = fea*eigvector;


%
% See also LPP LGE
%
%Reference:
%
%   Xiaofei He Deng Cai Shuicheng Yan and Hong-Jiang
%   Zhang “Neighborhood Preserving embedding“ Tenth IEEE International 
%   Conference on Computer Vision (ICCV‘2005) 2005
%
%   Sam Roweis & Lawrence Saul. “Nonlinear dimensionality reduction by 

评论

共有 条评论

相关资源