亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? constructw.m

?? concttuc one matrix using matlab
?? M
?? 第 1 頁 / 共 2 頁
字號:
function [W, elapse] = constructW(fea,options)
%	Usage:
%	W = constructW(fea,options)
%
%	fea: Rows of vectors of data points. Each row is x_i
%   options: Struct value in Matlab. The fields in options that can be set:
%           Metric -  Choices are:
%               'Euclidean' - Will use the Euclidean distance of two data 
%                             points to evaluate the "closeness" between 
%                             them. [Default One]
%               'Cosine'    - Will use the cosine value of two vectors
%                             to evaluate the "closeness" between them.
%                             A popular similarity measure used in
%                             Information Retrieval.
%                  
%           NeighborMode -  Indicates how to construct the graph. Choices
%                           are: [Default 'KNN']
%                'KNN'            -  k = 0
%                                       Complete graph
%                                    k > 0
%                                      Put an edge between two nodes if and
%                                      only if they are among the k nearst
%                                      neighbors of each other. You are
%                                      required to provide the parameter k in
%                                      the options. Default k=5.
%               'Supervised'      -  k = 0
%                                       Put an edge between two nodes if and
%                                       only if they belong to same class. 
%                                    k > 0
%                                       Put an edge between two nodes if
%                                       they belong to same class and they
%                                       are among the k nearst neighbors of
%                                       each other. 
%                                    Default: k=0
%                                   You are required to provide the label
%                                   information gnd in the options.
%                                              
%           WeightMode   -  Indicates how to assign weights for each edge
%                           in the graph. Choices are:
%               'Binary'       - 0-1 weighting. Every edge receiveds weight
%                                of 1. [Default One]
%               'HeatKernel'   - If nodes i and j are connected, put weight
%                                W_ij = exp(-norm(x_i - x_j)/2t^2). This
%                                weight mode can only be used under
%                                'Euclidean' metric and you are required to
%                                provide the parameter t.
%               'Cosine'       - If nodes i and j are connected, put weight
%                                cosine(x_i,x_j). Can only be used under
%                                'Cosine' metric.
%               
%            k         -   The parameter needed under 'KNN' NeighborMode.
%                          Default will be 5.
%            gnd       -   The parameter needed under 'Supervised'
%                          NeighborMode.  Colunm vector of the label
%                          information for each data point.
%            bLDA      -   0 or 1. Only effective under 'Supervised'
%                          NeighborMode. If 1, the graph will be constructed
%                          to make LPP exactly same as LDA. Default will be
%                          0. 
%            t         -   The parameter needed under 'HeatKernel'
%                          WeightMode. Default will be 1
%         bNormalized  -   0 or 1. Only effective under 'Cosine' metric.
%                          Indicates whether the fea are already be
%                          normalized to 1. Default will be 0
%      bSelfConnected  -   0 or 1. Indicates whether W(i,i) == 1. Default 1
%                          if 'Supervised' NeighborMode & bLDA == 1,
%                          bSelfConnected will always be 1. Default 1.
%
%
%    Examples:
%
%       fea = rand(50,15);
%       options = [];
%       options.Metric = 'Euclidean';
%       options.NeighborMode = 'KNN';
%       options.k = 5;
%       options.WeightMode = 'HeatKernel';
%       options.t = 1;
%       W = constructW(fea,options);
%       
%       
%       fea = rand(50,15);
%       gnd = [ones(10,1);ones(15,1)*2;ones(10,1)*3;ones(15,1)*4];
%       options = [];
%       options.Metric = 'Euclidean';
%       options.NeighborMode = 'Supervised';
%       options.gnd = gnd;
%       options.WeightMode = 'HeatKernel';
%       options.t = 1;
%       W = constructW(fea,options);
%       
%       
%       fea = rand(50,15);
%       gnd = [ones(10,1);ones(15,1)*2;ones(10,1)*3;ones(15,1)*4];
%       options = [];
%       options.Metric = 'Euclidean';
%       options.NeighborMode = 'Supervised';
%       options.gnd = gnd;
%       options.bLDA = 1;
%       W = constructW(fea,options);      
%       
%
%    For more details about the different ways to construct the W, please
%    refer:
%       Deng Cai, Xiaofei He and Jiawei Han, "Document Clustering Using
%       Locality Preserving Indexing" IEEE TKDE, Dec. 2005.
%    
%
%    Written by Deng Cai (dengcai2 AT cs.uiuc.edu), April/2004, Feb/2006,
%                                             May/2007
% 

if (~exist('options','var'))
   options = [];
else
   if ~isstruct(options) 
       error('parameter error!');
   end
end

%=================================================
if ~isfield(options,'Metric')
    options.Metric = 'Cosine';
end

switch lower(options.Metric)
    case {lower('Euclidean')}
    case {lower('Cosine')}
        if ~isfield(options,'bNormalized')
            options.bNormalized = 0;
        end
    otherwise
        error('Metric does not exist!');
end

%=================================================
if ~isfield(options,'NeighborMode')
    options.NeighborMode = 'KNN';
end

switch lower(options.NeighborMode)
    case {lower('KNN')}  %For simplicity, we include the data point itself in the kNN
        if ~isfield(options,'k')
            options.k = 5;
        end
    case {lower('Supervised')}
        if ~isfield(options,'bLDA')
            options.bLDA = 0;
        end
        if options.bLDA
            options.bSelfConnected = 1;
        end
        if ~isfield(options,'k')
            options.k = 0;
        end
        if ~isfield(options,'gnd')
            error('Label(gnd) should be provided under ''Supervised'' NeighborMode!');
        end
        if ~isempty(fea) && length(options.gnd) ~= size(fea,1)
            error('gnd doesn''t match with fea!');
        end
    otherwise
        error('NeighborMode does not exist!');
end

%=================================================

if ~isfield(options,'WeightMode')
    options.WeightMode = 'Binary';
end

bBinary = 0;
switch lower(options.WeightMode)
    case {lower('Binary')}
        bBinary = 1; 
    case {lower('HeatKernel')}
        if ~strcmpi(options.Metric,'Euclidean')
            warning('''HeatKernel'' WeightMode should be used under ''Euclidean'' Metric!');
            options.Metric = 'Euclidean';
        end
        if ~isfield(options,'t')
            options.t = 1;
        end
    case {lower('Cosine')}
        if ~strcmpi(options.Metric,'Cosine')
            warning('''Cosine'' WeightMode should be used under ''Cosine'' Metric!');
            options.Metric = 'Cosine';
        end
        if ~isfield(options,'bNormalized')
            options.bNormalized = 0;
        end
    otherwise
        error('WeightMode does not exist!');
end

%=================================================

if ~isfield(options,'bSelfConnected')
    options.bSelfConnected = 1;
end

%=================================================
tmp_T = cputime;

if isfield(options,'gnd') 
    nSmp = length(options.gnd);
else
    nSmp = size(fea,1);
end
maxM = 62500000; %500M
BlockSize = floor(maxM/(nSmp*3));


if strcmpi(options.NeighborMode,'Supervised')
    Label = unique(options.gnd);
    nLabel = length(Label);
    if options.bLDA
        G = zeros(nSmp,nSmp);
        for idx=1:nLabel
            classIdx = options.gnd==Label(idx);
            G(classIdx,classIdx) = 1/sum(classIdx);
        end
        W = sparse(G);
        elapse = cputime - tmp_T;
        return;
    end
    
    switch lower(options.WeightMode)
        case {lower('Binary')}
            if options.k > 0
                G = zeros(nSmp*(options.k+1),3);
                idNow = 0;
                for i=1:nLabel
                    classIdx = find(options.gnd==Label(i));
                    D = EuDist2(fea(classIdx,:),[],0);
                    [dump idx] = sort(D,2); % sort each row
                    clear D dump;
                    idx = idx(:,1:options.k+1);
                    
                    nSmpClass = length(classIdx)*(options.k+1);
                    G(idNow+1:nSmpClass+idNow,1) = repmat(classIdx,[options.k+1,1]);
                    G(idNow+1:nSmpClass+idNow,2) = classIdx(idx(:));
                    G(idNow+1:nSmpClass+idNow,3) = 1;
                    idNow = idNow+nSmpClass;
                    clear idx
                end
                G = sparse(G(:,1),G(:,2),G(:,3),nSmp,nSmp);
                G = max(G,G');
            else
                G = zeros(nSmp,nSmp);
                for i=1:nLabel
                    classIdx = find(options.gnd==Label(i));
                    G(classIdx,classIdx) = 1;
                end
            end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
老汉av免费一区二区三区| 国产日韩欧美精品一区| 91最新地址在线播放| 狠狠v欧美v日韩v亚洲ⅴ| 免费在线视频一区| 日精品一区二区| 日本不卡123| 精品在线视频一区| 久久99精品久久久久| 九九热在线视频观看这里只有精品| 日韩精品成人一区二区三区 | 亚洲国产wwwccc36天堂| 综合激情成人伊人| 亚洲一二三区视频在线观看| 亚洲综合一二区| 日韩精品乱码av一区二区| 秋霞午夜鲁丝一区二区老狼| 久久精品国产精品亚洲红杏| 国产乱码精品一区二区三 | 最新久久zyz资源站| √…a在线天堂一区| 亚洲狠狠爱一区二区三区| 五月综合激情日本mⅴ| 精品写真视频在线观看| 国产经典欧美精品| 色噜噜偷拍精品综合在线| 欧美日韩国产成人在线免费| 日韩一区二区视频| 中文字幕中文字幕一区| 亚洲h动漫在线| 国产精品一区二区三区乱码| 色综合婷婷久久| 制服丝袜亚洲播放| 国产精品入口麻豆九色| 午夜精品久久久久久久99水蜜桃| 九九视频精品免费| 91最新地址在线播放| 日韩免费视频一区| 一区二区三区视频在线观看| 美女网站在线免费欧美精品| av中文字幕不卡| 日韩亚洲欧美在线观看| 国产精品久久毛片av大全日韩| 午夜欧美大尺度福利影院在线看| 成人综合婷婷国产精品久久| 91麻豆精品91久久久久同性| 亚洲私人黄色宅男| 国产一区二区三区av电影| 欧美亚洲综合色| 中文字幕一区二区三区四区 | 欧美高清性hdvideosex| 欧美高清在线视频| 午夜精品久久久久久久99樱桃| 国产91丝袜在线观看| 5858s免费视频成人| 亚洲人成在线播放网站岛国| 国产一区亚洲一区| 欧美一区二区三区在线| 亚洲资源在线观看| 99久久婷婷国产综合精品电影| 久久午夜色播影院免费高清| 男人的天堂久久精品| 欧美喷水一区二区| 亚洲午夜在线电影| 欧洲一区二区av| 亚洲三级在线免费| 成人黄色一级视频| 欧美激情综合五月色丁香小说| 国内精品伊人久久久久av影院| 欧美肥妇free| 日本中文一区二区三区| 欧美电影在线免费观看| 亚洲高清视频在线| 在线视频欧美区| 一区二区欧美在线观看| 欧美系列亚洲系列| 性感美女极品91精品| 欧美精品第一页| 久久国产精品99精品国产| 日韩免费观看高清完整版| 精品夜夜嗨av一区二区三区| 久久伊人蜜桃av一区二区| 国产一区中文字幕| 国产精品成人在线观看| 99国产精品国产精品久久| 亚洲蜜臀av乱码久久精品| 欧美性xxxxxx少妇| 麻豆91免费看| 国产日本一区二区| 成人app软件下载大全免费| 亚洲欧美日韩中文播放 | 亚洲特级片在线| 欧美性生活一区| 麻豆成人av在线| 中文av字幕一区| 在线免费观看日本欧美| 久久99精品国产| 久久免费美女视频| 成人a区在线观看| 一区二区三区在线高清| 日韩欧美黄色影院| caoporen国产精品视频| 亚洲国产日韩综合久久精品| 欧美成人一区二区| www.欧美色图| 日韩av一区二区三区四区| 久久精品欧美一区二区三区麻豆| 成人午夜短视频| 日韩精品视频网站| 国产欧美日韩在线看| 欧美三级视频在线播放| 韩日av一区二区| 亚洲国产精品精华液网站| 久久久久久久久99精品| 欧美色中文字幕| 成人天堂资源www在线| 日韩精品每日更新| 中文字幕日韩一区| 精品sm在线观看| 欧美午夜在线一二页| 成人黄色一级视频| 韩国女主播成人在线观看| 亚洲与欧洲av电影| 欧美国产激情二区三区| 日韩三级高清在线| 欧美色倩网站大全免费| 成人丝袜视频网| 国精品**一区二区三区在线蜜桃| 亚洲图片欧美色图| 亚洲天堂成人网| 国产精品无码永久免费888| 日韩一区二区精品| 欧美三级电影精品| 一本一道久久a久久精品| 国产精品白丝av| 国内久久婷婷综合| 免费成人性网站| 亚洲aⅴ怡春院| 一区二区不卡在线视频 午夜欧美不卡在 | av亚洲精华国产精华精华| 精品一区二区三区的国产在线播放| 亚洲在线观看免费| 亚洲精品乱码久久久久久| 中文字幕精品综合| 国产色一区二区| 久久久噜噜噜久久人人看| 欧美成人一区二区三区| 日韩欧美在线不卡| 日韩精品一区二区三区在线播放| 在线不卡免费av| 欧美日韩国产美| 欧美剧在线免费观看网站| 欧美日本在线播放| 在线成人av网站| 日韩免费观看2025年上映的电影 | 亚洲欧美国产毛片在线| 国产精品久久二区二区| 国产精品国产自产拍高清av王其| 欧美极品另类videosde| 国产精品电影一区二区| 最新国产精品久久精品| 一区二区三区欧美日韩| 亚洲123区在线观看| 婷婷成人激情在线网| 蜜桃一区二区三区在线观看| 久久草av在线| 国产成人精品www牛牛影视| 国产高清成人在线| 成人18精品视频| 91欧美激情一区二区三区成人| 欧美视频一区二区| 日韩精品中文字幕在线不卡尤物| 欧美变态tickling挠脚心| 国产精品网站导航| 亚洲一区二区视频在线观看| 男人的天堂亚洲一区| 欧美日韩激情一区| 欧美一区国产二区| 日本一区二区免费在线观看视频| 亚洲欧美欧美一区二区三区| 亚洲成av人片在线观看| 国产酒店精品激情| 91麻豆福利精品推荐| 欧美一区日本一区韩国一区| 欧美国产一区在线| 午夜精品福利在线| 国产白丝网站精品污在线入口| 欧美亚洲一区二区在线| 久久久噜噜噜久噜久久综合| 洋洋av久久久久久久一区| 国内一区二区视频| 欧美色图天堂网| 国产免费成人在线视频| 亚洲v中文字幕| 粉嫩久久99精品久久久久久夜| 欧美日韩午夜在线视频| 国产精品美日韩| 久久se精品一区二区| 精品视频在线看| 国产精品国产三级国产|