latest version v1.9 - last update 10 Apr 2010 |
This is the base class for all Self Organizing Feature Maps. More...
#include <ltiSOFM.h>
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 |
SOFM & | copy (const SOFM &other) |
SOFM & | operator= (const SOFM &other) |
virtual classifier * | clone () const =0 |
const parameters & | getParameters () 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 dmatrix & | getPrototypes () 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 |
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.
lti::SOFM::SOFM | ( | ) |
default constructor
virtual lti::SOFM::~SOFM | ( | ) | [virtual] |
destructor
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.
feature | the vector to be classified | |
result | the result of the classification |
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.
copy data of "other" classifier.
other | the classifier to be copied |
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.
alias for copy member
other | the classifier to be copied |
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
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. |
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.
Implements lti::unsupervisedClassifier.
Implemented in lti::SOFM2D.
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.
input | the matrix with the input vectors (each row is a training vector) | |
ids | vector of class ids for each input point |
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
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. |
Reimplemented from lti::classifier.
Reimplemented in lti::SOFM2D.
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