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

lti::SOFM Class Reference

This is the base class for all Self Organizing Feature Maps. More...

#include <ltiSOFM.h>

Inheritance diagram for lti::SOFM:
Inheritance graph
[legend]
Collaboration diagram for lti::SOFM:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class SOFM More...

Public Member Functions

 SOFM ()
 SOFM (const SOFM &other)
virtual ~SOFM ()
virtual const char * getTypeName () const
SOFMcopy (const SOFM &other)
SOFMoperator= (const SOFM &other)
virtual classifierclone () const =0
const parametersgetParameters () const
virtual bool train (const dmatrix &input, ivector &ids)
virtual bool train (const dmatrix &input)=0
virtual bool classify (const dvector &feature, outputVector &result) const =0
virtual bool write (ioHandler &handler, const bool complete=true) const
virtual bool read (ioHandler &handler, const bool complete=true)
const dmatrixgetPrototypes () const

Protected Member Functions

virtual bool setLearnRates (const int &nbData)

Protected Attributes

dmatrix grid
double lrOrder
double lrOrderDelta
double sigma
double sigmaDelta
double lrConvergeA
double lrConvergeB

Detailed Description

This is the base class for all Self Organizing Feature Maps.

They are modelled after Kohonen's book 'Self-Organizing Maps' published by Springer in 1995.

SOFMs have a two phase training: In the first phase the ordering of the neurons is established. The neighborhood should be rather large during this phase. In the second phase the neurons are more finely tuned to the underlying probability distributions with a small neighborhood. This phase is called convergence phase.


Constructor & Destructor Documentation

lti::SOFM::SOFM (  ) 

default constructor

lti::SOFM::SOFM ( const SOFM other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::SOFM::~SOFM (  )  [virtual]

destructor


Member Function Documentation

virtual bool lti::SOFM::classify ( const dvector feature,
outputVector result 
) const [pure virtual]

Classification.

Classifies the feature and returns the outputVector with the classification result.

Parameters:
feature the vector to be classified
result the result of the classification
Returns:
false if an error occurred during classification else true

Implements lti::unsupervisedClassifier.

Implemented in lti::SOFM2D.

virtual classifier* lti::SOFM::clone (  )  const [pure virtual]

returns a pointer to a clone of this classifier.

Implements lti::classifier.

Implemented in lti::SOFM2D.

SOFM& lti::SOFM::copy ( const SOFM other  ) 

copy data of "other" classifier.

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

Reimplemented from lti::unsupervisedClassifier.

Reimplemented in lti::SOFM2D.

const parameters& lti::SOFM::getParameters (  )  const

returns used parameters

Reimplemented from lti::unsupervisedClassifier.

Reimplemented in lti::SOFM2D.

const dmatrix& lti::SOFM::getPrototypes (  )  const [inline]

returns the prototypes of the SOFM.

Each row of the matrix contains one prototype. Depending on the dimensionality these are ordered in dimensions. For two dimensions it is Y,X giving first the prototype at (0,0) than at (0,1) and so on. In three dimensions Z has the highest order (Z,Y,X): (0,0,0),(0,0,1),...,(0,0,n),(0,1,0),...

Referenced by lti::SOFM2DVisualizer::componentPlane(), lti::SOFM2DVisualizer::drawClasses(), lti::SOFM2DVisualizer::sammonsMapper(), and lti::SOFM2DVisualizer::uMatrix().

virtual const char* lti::SOFM::getTypeName (  )  const [virtual]

returns the name of this type ("SOFM")

Reimplemented from lti::unsupervisedClassifier.

Reimplemented in lti::SOFM2D.

SOFM& lti::SOFM::operator= ( const SOFM other  ) 

alias for copy member

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

Reimplemented from lti::classifier.

Reimplemented in lti::SOFM2D.

virtual bool lti::SOFM::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

read the SOFM from the given ioHandler

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Reimplemented from lti::classifier.

Reimplemented in lti::SOFM2D.

virtual bool lti::SOFM::setLearnRates ( const int &  nbData  )  [protected, virtual]

calculate learn-rates and deltas from the parameters.

virtual bool lti::SOFM::train ( const dmatrix input  )  [pure virtual]

Unsupervised training.

The row vectors in the input matrix are used for training of the classifier.

Parameters:
input the matrix with the input vectors (each row is a training vector)
Returns:
true if successful, false otherwise. (if false you can check the error message with getStatusString())

Implements lti::unsupervisedClassifier.

Implemented in lti::SOFM2D.

virtual bool lti::SOFM::train ( const dmatrix input,
ivector ids 
) [virtual]

Unsupervised training.

The vectors in the input matrix will be put into groups according to the training algorithm. Additionally, an integer indicating the class each point belongs to is returned.

By default this method uses the other train method train(const dmatrix&) and then calls classify(const dvector&) to get the ids for each trainvector. These ids are then returned.

Parameters:
input the matrix with the input vectors (each row is a training vector)
ids vector of class ids for each input point
Returns:
true if successful, false otherwise. (if false you can check the error message with getStatusString())

Reimplemented from lti::unsupervisedClassifier.

Reimplemented in lti::SOFM2D.

virtual bool lti::SOFM::write ( ioHandler handler,
const bool  complete = true 
) const [virtual]

write the SOFM in the given ioHandler

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Reimplemented from lti::classifier.

Reimplemented in lti::SOFM2D.


Member Data Documentation

dmatrix lti::SOFM::grid [protected]

weights for each neuron in the grid

double lti::SOFM::lrConvergeA [protected]

parameter A for lr = A / (t+B) during convergence

double lti::SOFM::lrConvergeB [protected]

parameter B for lr = A / (t+B) during convergence

double lti::SOFM::lrOrder [protected]

learn-rate for first phase

double lti::SOFM::lrOrderDelta [protected]

learn-rate delta for first phase

double lti::SOFM::sigma [protected]

current sigma for neighborhood

double lti::SOFM::sigmaDelta [protected]

delta for sigma


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

Generated on Sat Apr 10 15:26:59 2010 for LTI-Lib by Doxygen 1.6.1