|
|
The Parameters Interface
Every SOM algorithm uses parameters. These can include the maximum number of iterations, the distance metric, the neighborhood function, etc. Also, different SOM algorithms can use different parameters. The Parameters interface represents a collection of parameters used by a SOM algorithm. Figure 1. UML diagram for the Parameters interface. Since JSOMap provides two SOM algorithm implementations, each one needs its own Parameters implementation. The OnlineParameters class stores the parameters needed by the online algorithm and the BatchParameters class stores the parameters needed by the batch algorithm. Figure 2. UML diagram for the Parameters implementations. The Metric InterfaceA distance metric computes the distance, or dissimilarity, between two patterns. A distance metric must satisfy the following conditions:
The Metric interface represents an arbitrary distance metric that computes the dissimilarity between two arbitrary (but of the same type) patterns. By being defined as an interface, different types of metrics can be used by some client without that client knowing which type of metric it is. For example, using a dot product metric causes a SOM algorithm to produce very different results than using a euclidean metric. Figure 3. UML diagram for the Metric interface. JSOMap provides two Metric implementations: DotProductDoubleMetric and EuclideanDoubleMetric. These classes calculate the dot product and euclidean metric for two vectors. The Decay InterfaceThe SOM algorithms use a number of monotonically decreasing functions of an integer variable. Examples include the learning rate and the neighborhood decrease schedule. There are many different forms of monotonically decreasing, or decay, functions, like an exponential, linear, or inverse decay. Figure 4. UML diagram for the Decay interface. JSOMap provides a single decay function of the form:
which looks like
Figure 5. Example of the Decay implementation provided by JSOMap. for initial = 5, final = 1, and kmax = 1000. The Kernel InterfaceA kernel function is some function K(x,x') described by the following properties
The neighborhood function used by the SOM algorithms is basically a kernel function whose width decreases over time. Thus, the Kernel interface in JSOMap represents the neighborhood function. It specifies a single method, calculate, that calculates the neighborhood value of the two nodes at the specified iteration. Generally, Kernel implementations will use some Metric to calculate the distance between the two nodes and some Decay to decrease the width of the kernel over time. Figure 6. UML diagram for the Kernel interface. JSOMap provides two implementations of the Kernel interface. The first, GaussianKernel, calculates the following
Since it uses a Metric for the distance calculation, GaussianKernel does not need to know the type of underlying pattern of the nodes. The second implementation, OnlineKernel, represents the neighborhood function used by the online SOM algorithm. It uses another Kernel for the actual neighborhood and a Decay for the learning rate. The value of the Kernel is simply scaled by the value of the Decay function. The PatternSelector InterfaceThe online SOM algorithm examines one pattern at a time; however, it does not specify how the patterns are chosen. The PatternSelector interface represents some way of choosing patterns from a data set based on an integer index. Figure 7. UML diagram for the PatternSelector interface. JSOMap's single implementation, BasicPatternSelector, simply returns the pattern at the specified index in the data set, in a circular fashion. That is, when the index exceeds the number of patterns in the data set, it wraps back around to zero.
|
Send mail to zcox@iastate.edu with
questions or comments about this web site.
|