GClasses
GClasses::SOM::SVG2DWeightReporter Class Reference

Detailed Description

Writes out sequentially numbered svg files giving the weight locations in 2 dimensions of input space connected by a mesh that connects each weight with its nearest neighbors. Writes one file each time newStatus is called and once when stop is called. The output of stop may duplicate the last newStatus's output, but is not guaranteed to.

Generated filenames will be of the form: base_d+.svg (where d+ means 1 or more decimal digits). If the training algorithm gives a good estimate of the number of iterations and sub-iterations, the number of digits in the name will be the same for all generated filenames. If the estimate is low, then the filename size may increase. If it does not give any estimate, more digits will be added at the 10 millionth filename. The digits will start counting at 1.

#include <GSelfOrganizingMap.h>

Inheritance diagram for GClasses::SOM::SVG2DWeightReporter:
GClasses::SOM::Reporter

Classes

struct  Point
 

Public Member Functions

 SVG2DWeightReporter (std::string baseFilename, std::size_t xDim, std::size_t yDim, bool showTrainingData=false)
 Create a weight reporter that will output the xDim,yDim dimensions to a filename created from baseFilename. If showTrainingData is true then the projection of the training data will also be displayed in the output files along with the network. More...
 
virtual ~SVG2DWeightReporter ()
 Virtual destructor for good memory hygiene. More...
 
virtual void newStatus (unsigned iteration, unsigned subIteration, const GSelfOrganizingMap &map)
 Output the weight visualization to the next filename. More...
 
virtual void start (const GMatrix *trainingData, int maxIterations=-1, int maxSubIterations=-1)
 See comment on Reporter::start(GMatrix*,int,int) More...
 
virtual void stop (unsigned iteration, unsigned subIteration, const GSelfOrganizingMap &map)
 Output the weight visualization for the final state. More...
 
- Public Member Functions inherited from GClasses::SOM::Reporter
virtual ~Reporter ()
 Destruct this reporter object. More...
 

Constructor & Destructor Documentation

GClasses::SOM::SVG2DWeightReporter::SVG2DWeightReporter ( std::string  baseFilename,
std::size_t  xDim,
std::size_t  yDim,
bool  showTrainingData = false 
)
inline

Create a weight reporter that will output the xDim,yDim dimensions to a filename created from baseFilename. If showTrainingData is true then the projection of the training data will also be displayed in the output files along with the network.

virtual GClasses::SOM::SVG2DWeightReporter::~SVG2DWeightReporter ( )
inlinevirtual

Virtual destructor for good memory hygiene.

Member Function Documentation

virtual void GClasses::SOM::SVG2DWeightReporter::newStatus ( unsigned  iteration,
unsigned  subIteration,
const GSelfOrganizingMap map 
)
virtual

Output the weight visualization to the next filename.

Implements GClasses::SOM::Reporter.

virtual void GClasses::SOM::SVG2DWeightReporter::start ( const GMatrix trainingData,
int  maxIterations = -1,
int  maxSubIterations = -1 
)
virtual

See comment on Reporter::start(GMatrix*,int,int)

Reimplemented from GClasses::SOM::Reporter.

virtual void GClasses::SOM::SVG2DWeightReporter::stop ( unsigned  iteration,
unsigned  subIteration,
const GSelfOrganizingMap map 
)
virtual

Output the weight visualization for the final state.

Reimplemented from GClasses::SOM::Reporter.