Code covered by the BSD License  

Highlights from
Statistical Learning Toolbox

from Statistical Learning Toolbox by Dahua Lin
Functions for statistical learning, pattern recognition and computer vision, covering many topics.

Description of slltsa
Home > sltoolbox > manifold > slltsa.m

slltsa

PURPOSE ^

SLLTSA Performs Local Tangent Space Alignment Learning

SYNOPSIS ^

function [GC, spectrum, CTS] = slltsa(X, G, dl, dg)

DESCRIPTION ^

SLLTSA Performs Local Tangent Space Alignment Learning

 $ Syntax $
   - [GC, spectrum] = slltsa(X, G, dl)
   - [GC, spectrum] = slltsa(X, G, dl, dg)
   - [GC, spectrum, CTS] = slltsa(...)

 $ Arguments $
   - X:        The input sample matrix
   - G:        The neighborhood graph
   - dl:       The local dimension
   - dg:       The global embedding dimension
   - GC:       The global embedding coordinates
   - spectrum: The eigenvalue spectrum of the embedding space
   - CTS:      The struct of the coordinate transform system
               it has the following fields:
                   - means:   d0 x n
                   - bases:   d0 x dl x n
                   - ftrans:  dl x dg x n
                      the forward transforms: local coord -> global coord

 $ Description $
   - [GC, spectrum] = slltsa(X, G, dl) performs the local tangent space
     alignment learning based on the samples in X and the neighborhood
     graph in G. By default the global embedding dimension is set to the
     same as the local dimension.

   - [GC, spectrum] = slltsa(X, G, dl, dg) performs the LTSA with the 
     local and global embeding dimension respectively given.

   - [GC, spectrum, CTS] = slltsa(...) additionally returns the coordinate
     transform system.

 $ Remarks $
   - The implementation wraps the three major components:
       - sllocaltanspace:   learns the local tangent spaces
       - sllocaltancoords:  produces the local coordinates
       - sllocalcoordalign: pursues the global embedding by aligning the
                            local coordinates

 $ History $
   - Created by Dahua Lin, on Sep 13rd, 2006

CROSS-REFERENCE INFORMATION ^

This function calls:
  • sladjmat SLADJMAT Constructs the adjacency matrix representation of a graph
  • slgraphinfo SLGRAPHINFO Extracts basic information of a given graph representation
  • sllocalcoordalign SLLOCALCOORDALIGN Performs optimal local coordinate alignment
  • sllocaltancoords SLLOCALTANCOORDS Computes the local tangent coordinates
  • sllocaltanspace SLLOCALTANSPACE Solves the local tangent spaces
This function is called by:

SOURCE CODE ^

0001 function [GC, spectrum, CTS] = slltsa(X, G, dl, dg)
0002 %SLLTSA Performs Local Tangent Space Alignment Learning
0003 %
0004 % $ Syntax $
0005 %   - [GC, spectrum] = slltsa(X, G, dl)
0006 %   - [GC, spectrum] = slltsa(X, G, dl, dg)
0007 %   - [GC, spectrum, CTS] = slltsa(...)
0008 %
0009 % $ Arguments $
0010 %   - X:        The input sample matrix
0011 %   - G:        The neighborhood graph
0012 %   - dl:       The local dimension
0013 %   - dg:       The global embedding dimension
0014 %   - GC:       The global embedding coordinates
0015 %   - spectrum: The eigenvalue spectrum of the embedding space
0016 %   - CTS:      The struct of the coordinate transform system
0017 %               it has the following fields:
0018 %                   - means:   d0 x n
0019 %                   - bases:   d0 x dl x n
0020 %                   - ftrans:  dl x dg x n
0021 %                      the forward transforms: local coord -> global coord
0022 %
0023 % $ Description $
0024 %   - [GC, spectrum] = slltsa(X, G, dl) performs the local tangent space
0025 %     alignment learning based on the samples in X and the neighborhood
0026 %     graph in G. By default the global embedding dimension is set to the
0027 %     same as the local dimension.
0028 %
0029 %   - [GC, spectrum] = slltsa(X, G, dl, dg) performs the LTSA with the
0030 %     local and global embeding dimension respectively given.
0031 %
0032 %   - [GC, spectrum, CTS] = slltsa(...) additionally returns the coordinate
0033 %     transform system.
0034 %
0035 % $ Remarks $
0036 %   - The implementation wraps the three major components:
0037 %       - sllocaltanspace:   learns the local tangent spaces
0038 %       - sllocaltancoords:  produces the local coordinates
0039 %       - sllocalcoordalign: pursues the global embedding by aligning the
0040 %                            local coordinates
0041 %
0042 % $ History $
0043 %   - Created by Dahua Lin, on Sep 13rd, 2006
0044 %
0045 
0046 %% parse and verify input arguments
0047 
0048 if ~isnumeric(X) || ndims(X) ~= 2
0049     error('X should be a 2D numeric matrix');
0050 end
0051 n = size(X, 2);
0052 
0053 gi = slgraphinfo(G, {[n, n]});
0054 
0055 if nargin < 4
0056     dg = dl;
0057 end
0058 
0059 if ~strcmp(gi.form, 'adjmat')
0060     G = sladjmat(G, 'sparse', true);
0061 end
0062 
0063 out_cts = (nargout >= 3);
0064 
0065 
0066 %% main skeleton
0067 
0068 % learn local tangent spaces
0069 [LM, LP] = sllocaltanspace(X, G, dl);
0070 
0071 % compute local coordinates
0072 [Y, GM] = sllocaltancoords(LM, LP, X, G, 'T');
0073 if ~out_cts
0074     clear LM LP;
0075 end
0076 
0077 % align local systems to global embedding
0078 if out_cts
0079     [GC, spectrum, LT] = sllocalcoordalign(GM, Y, dg);
0080 else
0081     [GC, spectrum] = sllocalcoordalign(GM, Y, dg);
0082 end
0083 
0084 % organize output
0085 if out_cts
0086     CTS.means = LM;
0087     CTS.bases = LP;
0088     CTS.ftrans = LT;
0089 end
0090

Generated on Wed 20-Sep-2006 12:43:11 by m2html © 2003

Contact us at files@mathworks.com