at.tuwien.ifs.somtoolbox.models
Class GrowingSOM

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.models.AbstractNetworkModel
      extended by at.tuwien.ifs.somtoolbox.models.GrowingSOM
All Implemented Interfaces:
SOMToolboxApp, NetworkModel
Direct Known Subclasses:
MnemonicSOM

public class GrowingSOM
extends AbstractNetworkModel
implements SOMToolboxApp

This class implements the Growing Self-Organizing Map. It is basically a wrapper for the GrowingLayer and mainly handles command line execution and parameters. It implements the NetworkModel interface wich is currently not used, but may be used in the future.

Version:
$Id: GrowingSOM.java 3883 2010-11-02 17:13:23Z frank $
Author:
Michael Dittenbach

Nested Class Summary
private  class GrowingSOM.IntermediateSOMDumper
           
 
Nested classes/interfaces inherited from interface at.tuwien.ifs.somtoolbox.apps.SOMToolboxApp
SOMToolboxApp.Type
 
Field Summary
static SOMToolboxApp.Type APPLICATION_TYPE
           
static String DESCRIPTION
           
protected  GrowingLayer layer
           
static String LONG_DESCRIPTION
           
static com.martiansoftware.jsap.Parameter[] OPTIONS
           
 
Fields inherited from class at.tuwien.ifs.somtoolbox.models.AbstractNetworkModel
DEFAULT_LABEL_COUNT, labelled, sharedInputObjects, trainingStart
 
Fields inherited from interface at.tuwien.ifs.somtoolbox.apps.SOMToolboxApp
DEV_BY_STRING, HOMEPAGE, REQUIRED_MEMBERS, TYPE_GROUPED_COMPARATOR
 
Constructor Summary
protected GrowingSOM()
          only used for subclassing
  GrowingSOM(boolean norm, SOMProperties props, InputData data)
          Constructs a new GrowingSOM with dim-dimensional weight vectors.
  GrowingSOM(int xSize, int ySize, int numIterations, InputData data)
          Constructs and trains a new GrowingSOM.
  GrowingSOM(int xSize, int ySize, int zSize, String metricName, int numIterations, boolean normalised, boolean usePCAInit, int randomSeed, InputData data)
          Constructs and trains a new GrowingSOM.
  GrowingSOM(int id, Unit su, int dim, boolean norm, SOMProperties props, InputData data)
          Constructs a new GrowingSOM with dim-dimensional weight vectors.
protected GrowingSOM(int id, Unit su, SOMInputReader ir)
          Private constructor used recursively in hierarchical network models consisting of multiple maps.
protected GrowingSOM(int id, Unit su, SOMInputReader ir, GrowingLayer layer)
           
  GrowingSOM(Properties properties)
           
  GrowingSOM(SOMInputReader ir)
          Constructs an already trained GrowingSOM with a SOMInputReader provided by argument ir.
 
Method Summary
 Object clone()
           
 boolean equals(Object o)
           
 GrowingLayer getLayer()
          Returns the actual map layer.
private  void initLayer(boolean norm, SOMProperties props, InputData data)
           
static void main(String[] args)
          Method for stand-alone execution of map training.
private  void restoreLayer(int id, SOMInputReader ir, GrowingLayer layer)
           
 QualityMeasure train(InputData data, GHSOMProperties props, double targetQualityValue, String qualityMeasureName)
          Trains the map with the input data and training parameters specified in the properties provided by argument props.
 void train(InputData data, SOMProperties props)
          Trains the map with the input data and training parameters specified in the properties provided by argument props.
 
Methods inherited from class at.tuwien.ifs.somtoolbox.models.AbstractNetworkModel
getInputData, getSharedInputObjects, isLabelled, printTrainingTime, setLabelled, setSharedInputObjects
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTIONS

public static final com.martiansoftware.jsap.Parameter[] OPTIONS

APPLICATION_TYPE

public static final SOMToolboxApp.Type APPLICATION_TYPE

DESCRIPTION

public static String DESCRIPTION

LONG_DESCRIPTION

public static String LONG_DESCRIPTION

layer

protected GrowingLayer layer
Constructor Detail

GrowingSOM

public GrowingSOM(Properties properties)
           throws PropertiesException
Throws:
PropertiesException

GrowingSOM

public GrowingSOM(boolean norm,
                  SOMProperties props,
                  InputData data)
Constructs a new GrowingSOM with dim-dimensional weight vectors. Argument norm determines whether the randomly initialised weight vectors should be normalised to unit length or not.

Parameters:
norm - specifies if the weight vectors are to be normalised to unit length.
props - the network properties.

GrowingSOM

public GrowingSOM(int xSize,
                  int ySize,
                  int numIterations,
                  InputData data)
           throws PropertiesException
Constructs and trains a new GrowingSOM. All the non-specified parameters will be automatically set to "default" values.

Throws:
PropertiesException

GrowingSOM

public GrowingSOM(int xSize,
                  int ySize,
                  int zSize,
                  String metricName,
                  int numIterations,
                  boolean normalised,
                  boolean usePCAInit,
                  int randomSeed,
                  InputData data)
           throws PropertiesException
Constructs and trains a new GrowingSOM.

Throws:
PropertiesException

GrowingSOM

public GrowingSOM(int id,
                  Unit su,
                  int dim,
                  boolean norm,
                  SOMProperties props,
                  InputData data)
Constructs a new GrowingSOM with dim-dimensional weight vectors. Argument norm determines whether the randlomy initialized weight vectors should be normalized to unit length or not. In hierarchical network models consisting of multiple maps such as the GHSOM, a unique identifier is assigned by argument id and the superordinate unit is provided by argument su.

Parameters:
id - a unique identifier used in hierarchies of maps (e.g. the GHSOM).
su - the superordinate unit of the map.
dim - the dimensionality of the weight vectors.
norm - specifies if the weight vectors are to be normalized to unit length.
props - the network properties.

GrowingSOM

protected GrowingSOM(int id,
                     Unit su,
                     SOMInputReader ir)
Private constructor used recursively in hierarchical network models consisting of multiple maps. A unique identifier is assigned by argument id and the superordinate unit is provided by argument su.

Parameters:
id - a unique identifier used in hierarchies of maps (e.g. the GHSOM).
su - the superordinate unit of the map.
ir - an object implementing the SOMinputReader interface to load an already trained model.

GrowingSOM

protected GrowingSOM(int id,
                     Unit su,
                     SOMInputReader ir,
                     GrowingLayer layer)

GrowingSOM

public GrowingSOM(SOMInputReader ir)
Constructs an already trained GrowingSOM with a SOMInputReader provided by argument ir.

Parameters:
ir - an object implementing the SOMinputReader interface to load an already trained model.

GrowingSOM

protected GrowingSOM()
only used for subclassing

Method Detail

main

public static void main(String[] args)
Method for stand-alone execution of map training. Options are:

Parameters:
args - the execution arguments as stated above.

initLayer

private void initLayer(boolean norm,
                       SOMProperties props,
                       InputData data)

restoreLayer

private void restoreLayer(int id,
                          SOMInputReader ir,
                          GrowingLayer layer)

getLayer

public GrowingLayer getLayer()
Returns the actual map layer.

Returns:
the actual map layer

train

public QualityMeasure train(InputData data,
                            GHSOMProperties props,
                            double targetQualityValue,
                            String qualityMeasureName)
Trains the map with the input data and training parameters specified in the properties provided by argument props. If the value of property tau is 1, a fix-sized layer is trained, otherwise the layer grows until a certain quality criterion determined by tau and the mean quantization error specified by argument mqe0 of the data (which is automatically calculated) is reached. This method is usually used for GHSOM training.

Parameters:
data - input data to train the map with.
props - the training properties.
targetQualityValue - the desired granularity of data representation. Used for maps in GHSOMs.

train

public void train(InputData data,
                  SOMProperties props)
Trains the map with the input data and training parameters specified in the properties provided by argument props. If the value of property tau is 1, a fix-sized layer is trained, otherwise the layer grows until a certain quality criterion determined by tau and the mean quantization error of the data (which is automatically calculated) is reached.

Parameters:
data - input data to train the map with.
props - the training properties

equals

public boolean equals(Object o)
Overrides:
equals in class Object

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException