Functions
contrib/mul/mcal/mcal_extract_mode.cxx File Reference

Functions to learn modes from subsets of data. More...

#include "mcal_extract_mode.h"
#include <vnl/algo/vnl_symmetric_eigensystem.h>
#include <vcl_algorithm.h>
#include <vcl_iostream.h>
#include <mbl/mbl_data_array_wrapper.h>
#include <mcal/mcal_pca.h>

Go to the source code of this file.

Functions

void mcal_extract_mode (vcl_vector< vnl_vector< double > > &dv, const vcl_vector< unsigned > &used, vnl_vector< double > &mode, double &var)
 Computes one mode from used elements of each dv.
void mcal_extract_mode (vcl_vector< vnl_vector< double > > &dv, vnl_vector< double > &mode, double &var)
 Computes one mode by applying PCA to dv.
void mcal_extract_modes (vcl_vector< vnl_vector< double > > &dv, const vcl_vector< vcl_vector< unsigned > > &used, unsigned max_modes, double var_prop, vnl_matrix< double > &modes, vnl_vector< double > &mode_var)
 Compute modes and associated variance of supplied data.

Detailed Description

Functions to learn modes from subsets of data.

Author:
Tim Cootes

Definition in file mcal_extract_mode.cxx.


Function Documentation

void mcal_extract_mode ( vcl_vector< vnl_vector< double > > &  dv,
const vcl_vector< unsigned > &  used,
vnl_vector< double > &  mode,
double &  var 
)

Computes one mode from used elements of each dv.

Effectives computes the first eigenvector of the covariance matrix formed from selecting the used elements of each dv[i], ie dv[i][used[j]]. Resulting vector is returned as a full length vector (the same size as dv[i]).

The contribution of this vector is removed from each dv, dv[i]-=mode*b, where b=dv[i].mode

Definition at line 22 of file mcal_extract_mode.cxx.

void mcal_extract_mode ( vcl_vector< vnl_vector< double > > &  dv,
vnl_vector< double > &  mode,
double &  var 
)

Computes one mode by applying PCA to dv.

Effectives computes the first eigenvector of the covariance matrix. The contribution of this vector is removed from each dv, dv[i]-=mode*b, where b=dv[i].mode

Definition at line 76 of file mcal_extract_mode.cxx.

void mcal_extract_modes ( vcl_vector< vnl_vector< double > > &  dv,
const vcl_vector< vcl_vector< unsigned > > &  used,
unsigned  max_modes,
double  var_prop,
vnl_matrix< double > &  modes,
vnl_vector< double > &  mode_var 
)

Compute modes and associated variance of supplied data.

Parameters:
used[i]indicates the set of elements to be used for mode i. Modes beyond used.size() will use all elements.

Definition at line 107 of file mcal_extract_mode.cxx.