latest version v1.9 - last update 10 Apr 2010 |
This is a Self-Organizing Feature Map with a 2-D grid of neurons. More...
#include <ltiSOFM2D.h>
Classes | |
class | parameters |
the parameters for the class SOFM2D More... | |
Public Member Functions | |
SOFM2D () | |
SOFM2D (const SOFM2D &other) | |
virtual | ~SOFM2D () |
virtual const char * | getTypeName () const |
SOFM2D & | copy (const SOFM2D &other) |
SOFM2D & | operator= (const SOFM2D &other) |
virtual classifier * | clone () const |
const parameters & | getParameters () const |
virtual bool | train (const dmatrix &input, ivector &ids) |
virtual bool | train (const dmatrix &input) |
virtual bool | classify (const dvector &feature, outputVector &result) const |
point | size () const |
int | xSize () const |
int | ySize () const |
virtual bool | write (ioHandler &handler, const bool complete=true) const |
virtual bool | read (ioHandler &handler, const bool complete=true) |
Protected Member Functions | |
bool | calcSize (const dmatrix &data) |
bool | initGrid (const dmatrix &data) |
void | getNeighborhoodKernel (const int &maxN, kernel2D< double > &facN) |
bool | trainDist (const dmatrix &data) |
bool | trainDot (const dmatrix &data) |
Protected Attributes | |
int | sizeX |
int | sizeY |
double | eva1 |
double | eva2 |
dvector | eve1 |
dvector | eve2 |
This is a Self-Organizing Feature Map with a 2-D grid of neurons.
lti::SOFM2D::SOFM2D | ( | ) |
default constructor
lti::SOFM2D::SOFM2D | ( | const SOFM2D & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::SOFM2D::~SOFM2D | ( | ) | [virtual] |
destructor
bool lti::SOFM2D::calcSize | ( | const dmatrix & | data | ) | [protected] |
calculate sizeX and sizeY in case of param.calulateSize is true
virtual bool lti::SOFM2D::classify | ( | const dvector & | feature, | |
outputVector & | result | |||
) | const [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::SOFM.
Referenced by lti::SOFM2DVisualizer::drawClasses(), and lti::SOFM2DVisualizer::drawHits().
virtual classifier* lti::SOFM2D::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this classifier.
Implements lti::SOFM.
copy data of "other" classifier.
other | the classifier to be copied |
Reimplemented from lti::SOFM.
void lti::SOFM2D::getNeighborhoodKernel | ( | const int & | maxN, | |
kernel2D< double > & | facN | |||
) | [protected] |
calculate the neigborhood kernel
const parameters& lti::SOFM2D::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::SOFM.
virtual const char* lti::SOFM2D::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("SOFM2D")
Reimplemented from lti::SOFM.
bool lti::SOFM2D::initGrid | ( | const dmatrix & | data | ) | [protected] |
initializes the grid according to parameters.initType
alias for copy member
other | the classifier to be copied |
Reimplemented from lti::SOFM.
virtual bool lti::SOFM2D::read | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | [virtual] |
point lti::SOFM2D::size | ( | ) | const [inline] |
virtual bool lti::SOFM2D::train | ( | const dmatrix & | input | ) | [virtual] |
Unsupervised training.
The row vectors in the input
matrix are used for training of the classifier.
Implements lti::SOFM.
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::SOFM.
bool lti::SOFM2D::trainDist | ( | const dmatrix & | data | ) | [protected] |
train the SOFM using L1- or L2-Norm
virtual bool lti::SOFM2D::write | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | const [virtual] |
int lti::SOFM2D::xSize | ( | ) | const [inline] |
Returns the size of the map in x-direction (number of columns).
References sizeX.
Referenced by lti::SOFM2DVisualizer::componentPlane(), lti::SOFM2DVisualizer::drawClasses(), lti::SOFM2DVisualizer::drawHits(), lti::SOFM2DVisualizer::sammonsMapper(), and lti::SOFM2DVisualizer::uMatrix().
int lti::SOFM2D::ySize | ( | ) | const [inline] |
Returns the size of the map in y-direction (number of rows).
References sizeY.
Referenced by lti::SOFM2DVisualizer::componentPlane(), lti::SOFM2DVisualizer::drawClasses(), lti::SOFM2DVisualizer::drawHits(), lti::SOFM2DVisualizer::sammonsMapper(), and lti::SOFM2DVisualizer::uMatrix().
double lti::SOFM2D::eva1 [protected] |
the highest eigenvalue of the train data
double lti::SOFM2D::eva2 [protected] |
the second highest eigenvalue of the train data
dvector lti::SOFM2D::eve1 [protected] |
the the eigenvector corresponding to eva1
dvector lti::SOFM2D::eve2 [protected] |
the the eigenvector corresponding to eva2
int lti::SOFM2D::sizeX [protected] |
int lti::SOFM2D::sizeY [protected] |