at.tuwien.ifs.somtoolbox.properties
Class SOMProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by at.tuwien.ifs.somtoolbox.properties.SOMProperties
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>
Direct Known Subclasses:
GHSOMProperties

public class SOMProperties
extends Properties

Properties for SOM training.

Version:
$Id: SOMProperties.java 3899 2010-11-03 16:47:00Z mayer $
Author:
Michael Dittenbach, Rudolf Mayer
See Also:
Serialized Form

Nested Class Summary
 class SOMProperties.DatumToUnitMapping
           
 
Field Summary
private  double[] adaptiveCoordinatesThreshold
           
private  boolean batchSom
           
private  String classInfoFileName
           
private  Vector<SOMProperties.DatumToUnitMapping> datumToUnitMappings
           
private static String DEFAULT_METRIC_NAME
           
static double defaultLearnRate
           
private  int dumpEvery
           
private  Layer.GridLayout gridLayout
           
private  Layer.GridTopology gridTopology
           
private  String growthQualityMeasureName
           
private  double learnrate
           
private static String METRIC_PACKAGE
           
private  String metricName
           
private  int minimumFeatureDensity
           
static int MODE_EXCEPT
           
static int MODE_FAVOUR
           
static int MODE_NORMAL
           
private  int neighbourWidth
           
private  int numCycles
           
private  int numIterations
           
static String propertiesFileNameSuffix
           
private  long randomSeed
           
private  ArrayList<String> selectedClasses
           
private  int selectedClassMode
           
private static long serialVersionUID
           
private  double sigma
           
private  double tau
           
private  boolean usePCA
           
static String WORKING_DIRECTORY
           
private  int xSize
           
private  int ySize
           
private  int zSize
           
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
SOMProperties(int xSize, int ySize, int numIterations, double lernrate)
           
SOMProperties(int xSize, int ySize, int zSize, long seed, int trainingCycles, int trainingIterations, double lernrate, double sigma, double tau, String metric, boolean usePCA)
           
SOMProperties(int xSize, int ySize, int zSize, long seed, int trainingCycles, int trainingIterations, int dumpEvery, double lernrate, double sigma, double tau, String metric, boolean usePCA)
           
SOMProperties(int xSize, int ySize, long seed, int numCycles, int numIterations, double learnrate, double sigma, double tau, String metricName, boolean usePCA)
           
SOMProperties(Properties properties)
           
SOMProperties(String fname)
          Loads and encapsulated properties for the SOM training process.
 
Method Summary
 double[] adaptiveCoordinatesTreshold()
           
 boolean batchSom()
          Returns the batch_som status.
 Vector<SOMProperties.DatumToUnitMapping> datumToUnitMappings()
           
 String getClassInfoFileName()
           
 int getDumpEvery()
          Default = -1 --> do not dump.
 Layer.GridLayout getGridLayout()
           
 Layer.GridTopology getGridTopology()
           
 int getMinimumFeatureDensity()
           
 ArrayList<String> getSelectedClasses()
          Returns an ArrayList of Strings containing the class names which should be excluded from training.
 int getSelectedClassMode()
           
 String growthQualityMeasureName()
          Returns the name of the used quality measure.
 double learnrate()
          Returns the learnrate.
 String metricName()
          Returns the name of the used metric.
 int neighbourWidth()
          Returns the neighbour_width.
 int numCycles()
          Returns the number of training cycles.
 int numIterations()
          Returns the number of training iterations.
private  void parse()
           
 boolean pca()
           
 long randomSeed()
          Returns the random seed.
 double sigma()
          Returns sigma determining the neighbourhood radius.
 double tau()
          Returns tau determining the desired data representation granularity.
 int trainedIterations(int numVectors)
          Return the number of iterations really trained, either using numIterations or numCycles, whichever value is set.
private  void validatePropertyValues()
           
 void writeToFile(String dataName, String outputDir, boolean normalised)
          Writes the properties to a file.
 int xSize()
          Returns the number of units in horizontal direction.
 int ySize()
          Returns the number of units in vertical direction.
 int zSize()
          Returns the number of units in z-direction.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

WORKING_DIRECTORY

public static final String WORKING_DIRECTORY
See Also:
Constant Field Values

DEFAULT_METRIC_NAME

private static final String DEFAULT_METRIC_NAME

METRIC_PACKAGE

private static final String METRIC_PACKAGE
See Also:
Constant Field Values

defaultLearnRate

public static final double defaultLearnRate
See Also:
Constant Field Values

propertiesFileNameSuffix

public static final String propertiesFileNameSuffix
See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

batchSom

private boolean batchSom

neighbourWidth

private int neighbourWidth

learnrate

private double learnrate

metricName

private String metricName

growthQualityMeasureName

private String growthQualityMeasureName

numCycles

private int numCycles

numIterations

private int numIterations

dumpEvery

private int dumpEvery

randomSeed

private long randomSeed

sigma

private double sigma

tau

private double tau

xSize

private int xSize

ySize

private int ySize

zSize

private int zSize

gridTopology

private Layer.GridTopology gridTopology

gridLayout

private Layer.GridLayout gridLayout

usePCA

private boolean usePCA

datumToUnitMappings

private Vector<SOMProperties.DatumToUnitMapping> datumToUnitMappings

selectedClasses

private ArrayList<String> selectedClasses

classInfoFileName

private String classInfoFileName

selectedClassMode

private int selectedClassMode

minimumFeatureDensity

private int minimumFeatureDensity

adaptiveCoordinatesThreshold

private double[] adaptiveCoordinatesThreshold

MODE_NORMAL

public static final int MODE_NORMAL
See Also:
Constant Field Values

MODE_EXCEPT

public static final int MODE_EXCEPT
See Also:
Constant Field Values

MODE_FAVOUR

public static final int MODE_FAVOUR
See Also:
Constant Field Values
Constructor Detail

SOMProperties

public SOMProperties(int xSize,
                     int ySize,
                     int zSize,
                     long seed,
                     int trainingCycles,
                     int trainingIterations,
                     int dumpEvery,
                     double lernrate,
                     double sigma,
                     double tau,
                     String metric,
                     boolean usePCA)
              throws PropertiesException
Throws:
PropertiesException

SOMProperties

public SOMProperties(int xSize,
                     int ySize,
                     int zSize,
                     long seed,
                     int trainingCycles,
                     int trainingIterations,
                     double lernrate,
                     double sigma,
                     double tau,
                     String metric,
                     boolean usePCA)
              throws PropertiesException
Throws:
PropertiesException

SOMProperties

public SOMProperties(int xSize,
                     int ySize,
                     int numIterations,
                     double lernrate)
              throws PropertiesException
Throws:
PropertiesException

SOMProperties

public SOMProperties(int xSize,
                     int ySize,
                     long seed,
                     int numCycles,
                     int numIterations,
                     double learnrate,
                     double sigma,
                     double tau,
                     String metricName,
                     boolean usePCA)
              throws PropertiesException
Throws:
PropertiesException

SOMProperties

public SOMProperties(String fname)
              throws PropertiesException
Loads and encapsulated properties for the SOM training process.

Parameters:
fname - name of the properties file.
Throws:
PropertiesException - thrown if properties file could not be opened or the values of the properties are illegal.

SOMProperties

public SOMProperties(Properties properties)
              throws PropertiesException
Throws:
PropertiesException
Method Detail

getDumpEvery

public int getDumpEvery()
Default = -1 --> do not dump.

Returns:
iteration % dumpEvery == 0 --> dump

parse

private void parse()
            throws PropertiesException
Throws:
PropertiesException

validatePropertyValues

private void validatePropertyValues()
                             throws PropertiesException
Throws:
PropertiesException

getSelectedClasses

public ArrayList<String> getSelectedClasses()
Returns an ArrayList of Strings containing the class names which should be excluded from training.

Returns:
classes to be excluded from the training

getSelectedClassMode

public int getSelectedClassMode()

getClassInfoFileName

public String getClassInfoFileName()

batchSom

public boolean batchSom()
Returns the batch_som status.

Returns:
the batch_som status.

neighbourWidth

public int neighbourWidth()
Returns the neighbour_width.

Returns:
the neighbour_width.

learnrate

public double learnrate()
Returns the learnrate.

Returns:
the learnrate.

metricName

public String metricName()
Returns the name of the used metric.

Returns:
the name of the used metric.

growthQualityMeasureName

public String growthQualityMeasureName()
Returns the name of the used quality measure.

Returns:
the name of the used quality measure.

numCycles

public int numCycles()
Returns the number of training cycles.

Returns:
the number of training cycles.

numIterations

public int numIterations()
Returns the number of training iterations.

Returns:
the number of training iterations.

trainedIterations

public int trainedIterations(int numVectors)
Return the number of iterations really trained, either using numIterations or numCycles, whichever value is set.


randomSeed

public long randomSeed()
Returns the random seed.

Returns:
the random seed.

sigma

public double sigma()
Returns sigma determining the neighbourhood radius.

Returns:
sigma determining the neighbourhood radius.

tau

public double tau()
Returns tau determining the desired data representation granularity.

Returns:
tau determining the desired data representation granularity.

xSize

public int xSize()
Returns the number of units in horizontal direction.

Returns:
the number of units in horizontal direction.

ySize

public int ySize()
Returns the number of units in vertical direction.

Returns:
the number of units in vertical direction.

zSize

public int zSize()
Returns the number of units in z-direction. Default is 1

Returns:
the number of units in z-direction. Default is 1

getMinimumFeatureDensity

public int getMinimumFeatureDensity()

pca

public boolean pca()

getGridTopology

public Layer.GridTopology getGridTopology()

getGridLayout

public Layer.GridLayout getGridLayout()

datumToUnitMappings

public Vector<SOMProperties.DatumToUnitMapping> datumToUnitMappings()

writeToFile

public void writeToFile(String dataName,
                        String outputDir,
                        boolean normalised)
                 throws IOException
Writes the properties to a file.

Throws:
IOException

adaptiveCoordinatesTreshold

public double[] adaptiveCoordinatesTreshold()