GNGAlgorithm Class Reference

Encapsulates the GNG algorithm descibed by Fritzke. More...

#include <GNGAlgorithm.hpp>

Inheritance diagram for GNGAlgorithm:

GNGUAlgorithm SGNGAlgorithm List of all members.

Public Member Functions

 GNGAlgorithm (unsigned int MSEBackLog)
 Constructs a GNG Algorithm object.

virtual ~GNGAlgorithm ()
virtual void Initialize (unsigned int dim, IInputGenerator *g=0)
 Initializes the GNG Alg.

virtual void SetMSEOutputStream (std::ostream *f)
 Sets the output stream used to output the mean squared error.

virtual void UpdateMSE (double minDistance)
 Updates the current approximation of the mse, called once each iteration by iterate.

virtual void Iterate (Vector const &input)
 Iterates through the algorithm one time.

void SetComponentGNGContainer (IGNGContainer *i)
 Registers an IGNGContainer with the GNGAlgorithm object.

void SetComponentNodeInserter (IGNGNodeInserter *i)
 Registers an IGNGNodeInserter with the GNGAlgorithm object.

void SetComponentWinnerMovement (IGNGNodeMovement *i)
 Registers an IGNGNodeMovement with the GNGAlgorithm object.

void SetComponentNeighborMovement (IGNGNodeMovement *i)
 Registers an IGNGNodeMovement with the GNGAlgorithm object.

void SetParamAgeMax (double d)
 Sets the AgeMax parameter of the GNGAlgorithm.

void SetParamMoveWinner (double d)
 Sets the MoveWinner parameter of the GNGAlgorithm.

void SetParamMoveNeighbor (double d)
 Sets the MoveNeighbor parameter of the GNGAlgorithm.

void SetParamErrorDecay (double d)
 Sets the ErrorDecay parameter of the GNGAlgorithm.


Protected Member Functions

virtual void GetClosestNodes (GNGNode *&s, GNGNode *&t)
 Finds the two nodes closest to the current input Vector.

virtual void UpdateError (GNGNode &s)
 Updates the local error of a node.

virtual void IncreaseEdgeAges (GNGNode &s)
 Increases the age of all edges emenating from the node s.

virtual void MoveWinner (GNGNode &s)
 Moves the winner node s towards the current input vector by a factor of paramMoveWinner.

virtual void MoveNeighbor (GNGNode &s)
 Moves a neighbor node s towards the input vector by a factor of paramMoveNeighbor.

virtual void MoveNeighbors (GNGNode const &s)
 Moves the neighbors of the node s towards the input vector.

virtual void PurgeEdges ()
 Removes edges that are too old.

virtual void PurgeNodes ()
 Removes nodes that have no edges.

virtual void DecreaseNodeErrors ()
 Decreases the local error of all nodes.


Protected Attributes

IGNGNodeInserterm_nodeInserter
IGNGStopCriteria * m_stopCritera
IGNGNodeMovementm_winnerMovement
IGNGNodeMovementm_neighborMovement
IGNGContainerm_gngContainer
bool m_initDone
unsigned int m_dimension
Vector m_input
 dimension of nodes reference Vectors

std::ostream * m_mseStream
unsigned int m_MSEBackLog
double m_mse
double m_paramAgeIncrement
double m_paramAgeMax
double m_paramMoveWinner
double m_paramMoveNeighbor
double m_paramErrorDecay

Detailed Description

Encapsulates the GNG algorithm descibed by Fritzke.

Keeps a list of all edges. Creates and destroys edges and nodes through IGNGContainer. Updates local accumulated errors and decides where to insert new nodes using IGNGNodeInserter. It uses IGNGStopCriteria to decide when to stop.


Constructor & Destructor Documentation

GNGAlgorithm unsigned int  MSEBackLog  ) 
 

Constructs a GNG Algorithm object.

virtual ~GNGAlgorithm  )  [virtual]
 


Member Function Documentation

void Initialize unsigned int  dim,
IInputGenerator g = 0
[virtual]
 

Initializes the GNG Alg.

Parameters:
dim the dimension of the inputs and the GNGNodes.

virtual void SetMSEOutputStream std::ostream *  f  )  [virtual]
 

Sets the output stream used to output the mean squared error.

If the mse output stream isn't set, it will not be calculated.

Parameters:
f,the output stream used for outputing the mse

void UpdateMSE double  minDistance  )  [virtual]
 

Updates the current approximation of the mse, called once each iteration by iterate.

Parameters:
minDistance the distance between the input and the closest node.

void Iterate Vector const &  input  )  [virtual]
 

Iterates through the algorithm one time.

Parameters:
input the Input vector to use in this iteration

Reimplemented in GNGUAlgorithm.

void SetComponentGNGContainer IGNGContainer i  ) 
 

Registers an IGNGContainer with the GNGAlgorithm object.

Parameters:
i the IGNGContainer to register.

void SetComponentNodeInserter IGNGNodeInserter i  ) 
 

Registers an IGNGNodeInserter with the GNGAlgorithm object.

Parameters:
i the IGNGNodeInserter to register.

void SetComponentWinnerMovement IGNGNodeMovement i  ) 
 

Registers an IGNGNodeMovement with the GNGAlgorithm object.

This NodeMovement implementation determines how the winner node is moved.

Parameters:
i the IGNGNodeMovement to register.

void SetComponentNeighborMovement IGNGNodeMovement i  ) 
 

Registers an IGNGNodeMovement with the GNGAlgorithm object.

This NodeMovement implementation determines how neighbor nodes of the winner are moved.

Parameters:
i the IGNGNodeMovement to register.

void SetParamAgeMax double  d  ) 
 

Sets the AgeMax parameter of the GNGAlgorithm.

Parameters:
d the AgeMax parameter.

void SetParamMoveWinner double  d  ) 
 

Sets the MoveWinner parameter of the GNGAlgorithm.

Parameters:
d the MoveWinner parameter.

void SetParamMoveNeighbor double  d  ) 
 

Sets the MoveNeighbor parameter of the GNGAlgorithm.

Parameters:
d the MoveNeighbor parameter.

void SetParamErrorDecay double  d  ) 
 

Sets the ErrorDecay parameter of the GNGAlgorithm.

Parameters:
d the ErrorDecay parameter.

void GetClosestNodes GNGNode *&  s,
GNGNode *&  t
[protected, virtual]
 

Finds the two nodes closest to the current input Vector.

Returns:
s and t the closest nodes.

void UpdateError GNGNode s  )  [protected, virtual]
 

Updates the local error of a node.

Parameters:
s the node that will be updated.

Reimplemented in SGNGAlgorithm.

void IncreaseEdgeAges GNGNode s  )  [protected, virtual]
 

Increases the age of all edges emenating from the node s.

Parameters:
s the node connected to the edges.

void MoveWinner GNGNode s  )  [protected, virtual]
 

Moves the winner node s towards the current input vector by a factor of paramMoveWinner.

To change the behaviour of winner movment, overload this method.

Parameters:
s the node to move

Reimplemented in SGNGAlgorithm.

void MoveNeighbor GNGNode s  )  [protected, virtual]
 

Moves a neighbor node s towards the input vector by a factor of paramMoveNeighbor.

To change the behaviour of neighbor movment, overload this method.

Parameters:
s the node to move

Reimplemented in SGNGAlgorithm.

void MoveNeighbors GNGNode const &  s  )  [protected, virtual]
 

Moves the neighbors of the node s towards the input vector.

Parameters:
s the node whos neigbors are to be moved.
input the goal of the movement.

void PurgeEdges  )  [protected, virtual]
 

Removes edges that are too old.

Reimplemented in SGNGAlgorithm.

void PurgeNodes  )  [protected, virtual]
 

Removes nodes that have no edges.

Reimplemented in GNGUAlgorithm.

void DecreaseNodeErrors  )  [protected, virtual]
 

Decreases the local error of all nodes.


Member Data Documentation

IGNGNodeInserter* m_nodeInserter [protected]
 

IGNGStopCriteria* m_stopCritera [protected]
 

IGNGNodeMovement* m_winnerMovement [protected]
 

IGNGNodeMovement* m_neighborMovement [protected]
 

IGNGContainer* m_gngContainer [protected]
 

bool m_initDone [protected]
 

unsigned int m_dimension [protected]
 

Vector m_input [protected]
 

dimension of nodes reference Vectors

std::ostream* m_mseStream [protected]
 

unsigned int m_MSEBackLog [protected]
 

double m_mse [protected]
 

double m_paramAgeIncrement [protected]
 

double m_paramAgeMax [protected]
 

double m_paramMoveWinner [protected]
 

double m_paramMoveNeighbor [protected]
 

double m_paramErrorDecay [protected]
 


Generated on Mon Mar 22 16:40:49 2004 for GNG_GL by doxygen 1.3.6