LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::fastICA< T > Class Template Reference

This class implements a fast fixed point algorithm for the Independent Component Analysis (ICA). More...

#include <ltiFastICA.h>

Inheritance diagram for lti::fastICA< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::fastICA< T >:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class fastICA. More...

Public Member Functions

 fastICA ()
 fastICA (const parameters &par)
 fastICA (const fastICA &other)
virtual ~fastICA ()
virtual const char * getTypeName () const
virtual bool apply (matrix< T > &srcdest)
virtual bool apply (const matrix< T > &src, matrix< T > &dest)
bool computeTransformMatrix (const matrix< T > &src)
const matrix< T > & getRotationMatrix () const
bool getRotationMatrix (matrix< T > &dest) const
const matrix< T > & getWhiteningMatrix () const
bool getWhiteningMatrix (matrix< T > &dest) const
const matrix< T > & getTransformMatrix () const
bool getTransformMatrix (matrix< T > &dest) const
bool getOffsetVector (vector< T > &result) const
const vector< T > & getOffsetVector () const
bool transform (const matrix< T > &src, matrix< T > &dest) const
bool transform (matrix< T > &srcdest) const
bool transform (const vector< T > &src, vector< T > &dest) const
bool transform (vector< T > &srcdest) const
fastICAcopy (const fastICA &other)
fastICAoperator= (const fastICA &other)
virtual functorclone () const
const parametersgetParameters () const
virtual bool updateParameters ()

Protected Member Functions

bool centerData (matrix< T > &srcdest) const
bool icaDeflationary (const matrix< T > &src, matrix< T > &dest, const parameters &par) const
bool icaSymmetric (const matrix< T > &src, matrix< T > &dest, const parameters &par) const
bool closeEnough (const vector< T > &a, const vector< T > &b, const T epsilon) const
bool closeEnough (const matrix< T > &a, const matrix< T > &b, const T epsilon) const
expo1 (const T x) const
expo2 (const T x) const
tanh1 (const T x) const
tanh2 (const T x) const
kurt1 (const T x) const
kurt2 (const T x) const

Protected Attributes

principalComponents< T > pca
T(fastICA< T >::* g )(const T x) const
T(fastICA< T >::* gd )(const T x) const
a1
uniformDistribution uniDist
matrix< T > transformMatrix
matrix< T > whiteningMatrix
matrix< T > rotationMatrix

Detailed Description

template<class T>
class lti::fastICA< T >

This class implements a fast fixed point algorithm for the Independent Component Analysis (ICA).

It receives a set of input vectors in form of a matrix (each row of the matrix corresponds to an input vector), which will be transformed with ICA. (apply() methods)

If you only want to compute the transformation matrix you can use the computeTransformMatrix() methods.

Once the transformationMatrix is computed (by an apply, or computeTransformMatrix method) you can use the transform() methods to transform other datasets with the same transformation matrix.

Note that you have to subtract the offset vector from data you want to transform with the transformation matrix if not using the transform() methods.


Constructor & Destructor Documentation

template<class T>
lti::fastICA< T >::fastICA (  ) 

Default constructor.

template<class T>
lti::fastICA< T >::fastICA ( const parameters par  ) 

Construct a functor using the given parameters.

template<class T>
lti::fastICA< T >::fastICA ( const fastICA< T > &  other  ) 

Copy constructor.

Parameters:
other the object to be copied
template<class T>
virtual lti::fastICA< T >::~fastICA (  )  [virtual]

Destructor.


Member Function Documentation

template<class T>
virtual bool lti::fastICA< T >::apply ( const matrix< T > &  src,
matrix< T > &  dest 
) [virtual]

This computes a transformation matrix and transforms the given data.

Parameters:
src matrix with the source data. Each row represents a dataset.
dest matrix where the result will be left.
Returns:
true if apply successful or false otherwise.
template<class T>
virtual bool lti::fastICA< T >::apply ( matrix< T > &  srcdest  )  [virtual]

operates on the given parameter.

Parameters:
srcdest matrix with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
template<class T>
bool lti::fastICA< T >::centerData ( matrix< T > &  srcdest  )  const [protected]

method to center the data

template<class T>
virtual functor* lti::fastICA< T >::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Implements lti::functor.

template<class T>
bool lti::fastICA< T >::closeEnough ( const matrix< T > &  a,
const matrix< T > &  b,
const T  epsilon 
) const [protected]

method to determine if a vector is close enough to another

template<class T>
bool lti::fastICA< T >::closeEnough ( const vector< T > &  a,
const vector< T > &  b,
const T  epsilon 
) const [protected]

method to determine if a vector is close enough to another

template<class T>
bool lti::fastICA< T >::computeTransformMatrix ( const matrix< T > &  src  ) 

only computes the transformation matrix.

Parameters:
src matrix with the sourc data. Each row represents a dataset
Returns:
true if apply successful or false otherwise.
template<class T>
fastICA& lti::fastICA< T >::copy ( const fastICA< T > &  other  ) 

Copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

template<class T>
T lti::fastICA< T >::expo1 ( const T  x  )  const [protected]

First derivation of Exp negentropyApproximation.

template<class T>
T lti::fastICA< T >::expo2 ( const T  x  )  const [protected]

Second derivation of Exp negentropyApproximation.

template<class T>
const vector<T>& lti::fastICA< T >::getOffsetVector (  )  const

Returns the previously computed offset vector, which corresponds to the mean of the data.

Returns:
a const reference to the last computed or used offset vector.
template<class T>
bool lti::fastICA< T >::getOffsetVector ( vector< T > &  result  )  const

Returns the previously computed offset vector, which corresponds to the mean of the data.

Parameters:
result the offset vector will be written here.
Returns:
true if the matrix could be computed, false otherwise.
template<class T>
const parameters& lti::fastICA< T >::getParameters (  )  const

Returns used parameters.

Returns:
const reference to the parameter object of this functor.

Reimplemented from lti::functor.

template<class T>
bool lti::fastICA< T >::getRotationMatrix ( matrix< T > &  dest  )  const

Returns the saved rotation matrix, which was computed with ICA.

Parameters:
dest last computed or used rotation matrix will be stored here.
template<class T>
const matrix<T>& lti::fastICA< T >::getRotationMatrix (  )  const

Returns the saved rotation matrix, which was computed with ICA.

Returns:
a const reference to the last computed or used rotation matrix.
template<class T>
bool lti::fastICA< T >::getTransformMatrix ( matrix< T > &  dest  )  const

Returns the saved transformation matrix.

Parameters:
dest last computed or used transformation matrix will be stored here.
template<class T>
const matrix<T>& lti::fastICA< T >::getTransformMatrix (  )  const

Returns the saved transformation matrix.

This is only the product of (whitening matrix) * (rotation matrix).

Note: If you want to use the transformation matrix to transform datasets, you should subtract the offset vector from your data first.

Returns:
a const reference to the last computed or used transform matrix.
template<class T>
virtual const char* lti::fastICA< T >::getTypeName (  )  const [virtual]

Returns the name of this type ("fastICA").

Reimplemented from lti::linearAlgebraFunctor.

template<class T>
bool lti::fastICA< T >::getWhiteningMatrix ( matrix< T > &  dest  )  const

Returns the saved whitening matrix, which was computed with ICA.

Parameters:
dest last computed or used whitening matrix will be stored here.
template<class T>
const matrix<T>& lti::fastICA< T >::getWhiteningMatrix (  )  const

Returns the saved whitening matrix, which was computed with PCA.

Returns:
a const reference to the last computed or used whitening matrix.
template<class T>
bool lti::fastICA< T >::icaDeflationary ( const matrix< T > &  src,
matrix< T > &  dest,
const parameters par 
) const [protected]

ICA with deflationary approach.

template<class T>
bool lti::fastICA< T >::icaSymmetric ( const matrix< T > &  src,
matrix< T > &  dest,
const parameters par 
) const [protected]

ICA with symmetric approach.

template<class T>
T lti::fastICA< T >::kurt1 ( const T  x  )  const [protected]

First derivation of Pow4 negentropyApproximation (Kurtosis).

template<class T>
T lti::fastICA< T >::kurt2 ( const T  x  )  const [protected]

Second derivation of Pow4 negentropyApproximation (Kurtosis).

template<class T>
fastICA& lti::fastICA< T >::operator= ( const fastICA< T > &  other  ) 

Alias for copy member.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

template<class T>
T lti::fastICA< T >::tanh1 ( const T  x  )  const [protected]

First derivation of Tanh negentropyApproximation.

template<class T>
T lti::fastICA< T >::tanh2 ( const T  x  )  const [protected]

Second derivation of Tanh negentropyApproximation.

template<class T>
bool lti::fastICA< T >::transform ( vector< T > &  srcdest  )  const

Transforms a single vector according to a previously computed transformation matrix.

Parameters:
srcdest the input data, the result will be left here too
Returns:
true if operation was succesfull and false otherwise
template<class T>
bool lti::fastICA< T >::transform ( const vector< T > &  src,
vector< T > &  dest 
) const

Transforms a single vector according to a previously computed transformation matrix.

Parameters:
src the data vector
dest the transformed vector will be left here
template<class T>
bool lti::fastICA< T >::transform ( matrix< T > &  srcdest  )  const

Transform an entire matrix according to a previosly computed transformation matrix.

Parameters:
srcdest the input data, the result will be left here, too
Returns:
true if operation was succesfull and false otherwise
template<class T>
bool lti::fastICA< T >::transform ( const matrix< T > &  src,
matrix< T > &  dest 
) const

Transform an entire matrix according to a previosly computed transformation matrix.

Parameters:
src the input data
dest here the transformed data will be left
Returns:
true if operation was succesfull and false otherwise
template<class T>
virtual bool lti::fastICA< T >::updateParameters (  )  [virtual]

Update functor's parameters.

This member updates the internal state of the functor according to the parameter set.

Returns:
true if successful, false otherwise

Reimplemented from lti::functor.


Member Data Documentation

template<class T>
T lti::fastICA< T >::a1 [protected]

Constants for tuning negentropyApproximation functions are copied from parameters in setParameters to this variable.

template<class T>
T(fastICA<T>::* lti::fastICA< T >::g)(const T x) const [protected]

Function pointer to the non-linearity function which should be used.

This pointer is set in updateParameters dependent on the negentropyAproximation setting.

Default: negentropyApproximation

template<class T>
T(fastICA<T>::* lti::fastICA< T >::gd)(const T x) const [protected]

Function pointer to derivation of above g.

template<class T>
principalComponents<T> lti::fastICA< T >::pca [protected]

PCA functor which is applied before ICA with Whitening.

template<class T>
matrix<T> lti::fastICA< T >::rotationMatrix [protected]

Matrix which is used to save the whitening matrix.

template<class T>
matrix<T> lti::fastICA< T >::transformMatrix [protected]

Matrix which is used to save the transform matrix.

template<class T>
uniformDistribution lti::fastICA< T >::uniDist [protected]

Used to choose initial random vectors.

template<class T>
matrix<T> lti::fastICA< T >::whiteningMatrix [protected]

Matrix which is used to save the whitening matrix.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:28:19 2010 for LTI-Lib by Doxygen 1.6.1