亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
一区二区三区成人在线视频| 精品一区二区三区在线视频| 日本sm残虐另类| 国产精品中文字幕日韩精品| 色婷婷精品久久二区二区蜜臀av| 日韩午夜激情电影| 亚洲精品国产无套在线观| 国产高清成人在线| 制服丝袜亚洲色图| 亚洲三级在线播放| 高清不卡一区二区| 欧美成人女星排行榜| 性久久久久久久久久久久| 国产成人av电影在线播放| 精品国产乱码久久久久久影片| 亚洲黄色免费电影| av一二三不卡影片| 国产欧美日韩中文久久| 九九精品视频在线看| 56国语精品自产拍在线观看| 亚洲一区免费在线观看| 91免费看视频| 国产精品免费视频一区| 不卡一二三区首页| 国产视频在线观看一区二区三区 | 欧美日韩国产影片| 中文字幕一区二区三区蜜月| 国产二区国产一区在线观看| 日韩精品中文字幕在线一区| 爽好久久久欧美精品| 欧美在线观看视频在线| 亚洲精品成人a在线观看| 91亚洲精品乱码久久久久久蜜桃| 欧美国产在线观看| 国产精品亚洲人在线观看| 久久久精品tv| 国产成人亚洲综合a∨婷婷图片| 久久久av毛片精品| 丁香婷婷综合网| 亚洲人成网站精品片在线观看| av中文字幕不卡| 亚洲精品国产成人久久av盗摄| 色先锋资源久久综合| 亚洲第一激情av| 91精品国产色综合久久不卡电影 | 欧美久久一二三四区| 亚洲成人黄色小说| 欧美一区二区三区的| 精品一区二区在线看| 中文字幕中文字幕中文字幕亚洲无线| 成人涩涩免费视频| 亚洲欧美日韩系列| 91精品婷婷国产综合久久| 久久不见久久见免费视频1| xnxx国产精品| 色妞www精品视频| 日韩成人一级片| 久久久精品天堂| 色天使色偷偷av一区二区| 午夜视黄欧洲亚洲| 久久亚洲二区三区| 在线精品视频小说1| 蜜臀久久99精品久久久画质超高清 | 国产欧美一区二区精品性| thepron国产精品| 亚洲444eee在线观看| 亚洲精品在线一区二区| 99久久精品国产毛片| 日韩一区精品字幕| 国产精品美女久久久久高潮| 欧美日韩一区二区在线观看| 国产成人在线观看| 日韩一区精品视频| 国产精品高清亚洲| 精品精品国产高清一毛片一天堂| 波多野结衣欧美| 蜜桃视频在线观看一区| 成人免费在线视频| 精品国产免费人成在线观看| 欧美色图一区二区三区| 国产精品一线二线三线| 亚洲高清视频在线| 国产欧美精品区一区二区三区 | 色婷婷国产精品综合在线观看| 手机精品视频在线观看| 国产精品卡一卡二卡三| 欧美一级精品在线| 色就色 综合激情| 国产很黄免费观看久久| 日韩成人精品在线观看| 亚洲另类在线制服丝袜| 国产三级精品在线| 欧美成人在线直播| 欧美一区二区三区思思人| 色哟哟一区二区在线观看| 国产成人自拍网| 国产激情视频一区二区在线观看 | 久久先锋资源网| 在线不卡欧美精品一区二区三区| av资源站一区| 国产成人精品三级| 国产一区二区三区高清播放| 男女视频一区二区| 午夜精品久久久久久久久 | 国产精品盗摄一区二区三区| www久久精品| 精品成a人在线观看| 日韩亚洲欧美在线观看| 制服视频三区第一页精品| 欧美日韩在线一区二区| 欧美日韩一区二区三区在线看| 99精品久久久久久| 91视视频在线观看入口直接观看www| 国产精品亚洲一区二区三区在线| 精品一区在线看| 国产一区二区成人久久免费影院 | 日韩国产精品久久久久久亚洲| 一区二区三区中文字幕精品精品| 国产精品夫妻自拍| 亚洲免费av高清| 一区二区欧美精品| 午夜欧美在线一二页| 日韩高清电影一区| 久久激情五月婷婷| 激情六月婷婷久久| 国产精品资源网站| 92国产精品观看| 欧美日韩一区二区电影| 欧美精品在线观看播放| 欧美大片在线观看一区| 久久久www成人免费无遮挡大片| 国产香蕉久久精品综合网| 中文字幕欧美激情| 成人免费小视频| 石原莉奈在线亚洲三区| 另类专区欧美蜜桃臀第一页| 国产在线精品免费| 成人av免费在线播放| 日本精品裸体写真集在线观看| 欧美日韩中文国产| 亚洲精品在线电影| 亚洲日穴在线视频| 奇米影视一区二区三区小说| 国产精品一区免费在线观看| 色综合天天综合在线视频| 欧美群妇大交群中文字幕| 欧美精品一区二区三区一线天视频| 国产欧美日韩一区二区三区在线观看| 亚洲老司机在线| 麻豆91精品91久久久的内涵| 成人黄页毛片网站| 91精品国产欧美一区二区| 中文天堂在线一区| 日韩精品久久理论片| 成人性生交大片| 欧美精品少妇一区二区三区| 久久久不卡网国产精品二区| 亚洲最大成人综合| 国产精品亚洲成人| 欧美日韩国产经典色站一区二区三区| 欧美大片在线观看一区| 亚洲女同一区二区| 极品尤物av久久免费看| 91成人网在线| 久久欧美一区二区| 亚洲午夜久久久久久久久电影院| 久久99精品久久久久久| 日本韩国精品一区二区在线观看| 欧美成人女星排行榜| 亚洲国产美国国产综合一区二区| 夫妻av一区二区| 日韩欧美不卡一区| 视频在线观看91| 欧美日韩免费一区二区三区| 亚洲欧洲无码一区二区三区| 久久精品久久综合| 欧美日韩综合在线免费观看| 136国产福利精品导航| 国产在线精品一区二区| 91精品久久久久久蜜臀| 亚洲精品成人悠悠色影视| 国产91精品欧美| 精品sm在线观看| 久久91精品国产91久久小草| 欧美日韩一区 二区 三区 久久精品| 国产精品美女久久久久av爽李琼| 国产一区二区在线看| 欧美一区在线视频| 日本免费新一区视频| 欧美日韩久久久一区| 亚洲自拍都市欧美小说| 91在线观看高清| 国产精品美女久久久久aⅴ | 欧美三级电影一区| 1000精品久久久久久久久| 成人h精品动漫一区二区三区| 久久青草欧美一区二区三区| 国内精品视频666| 欧美精品一区二区不卡 | 91国偷自产一区二区开放时间 |