| Portability | non-portable (requires STM) |
|---|---|
| Stability | experimental |
| Maintainer | gnn.github@gmail.com |
Data.Datamining.Clustering.Gsom.Phase
Description
The GSOM Algorithm can be split up in multiple sequentially executed
s. Each of these phases makes a certain number of passes over
the inputs. While doing so each Phase modifies a given phase
according to a certain set of specified parameters.
This module contains the definition of the Lattice type, a few default
instances and the functions needed to run a single Phase or to
phase a sequence of runs.
Phase
- data Phase = Phase {
- passes :: Int
- neighbourhoodSize :: Int
- learningRate :: LearningRate
- kernel :: Kernel
- grow :: Bool
- spreadFactor :: Double
- type Phases = [Phase]
- defaultFirst :: Phase
- defaultSecond :: Phase
- defaultThird :: Phase
- defaults :: Phases
- growthThreshold :: Phase -> Int -> Double
- phase :: Phase -> Lattice -> Inputs -> IO Lattice
- run :: Phases -> Lattice -> Inputs -> IO Lattice
- data Kernel
- kernelFunction :: Kernel -> Double -> Int -> Double
- data LearningRate
- = Linear Double
- | InverseAge Double
- adaption :: LearningRate -> Int -> Int -> Double
Documentation
This datatype encapsulates all the parameters needed to be known to run one phase of the GSOM algorithm.
Constructors
| Phase | |
Fields
| |
The three default phases of the GSOM algorithm. They all use the bubble kernel and a linear learning rate decrease.
The default first phase is the only growing phase. It makes 5
passes over the input, uses an initial learning rate of 0.1 and
a starting neighbourhood size of 3. The is set
to 0.1.
spreadFactor
The default for the second phase is a smoothing phase making 50
passes over the input vectors with a learning rate of 0.05 and an
initial neighbourhood size of 2. Since there is no node growth the
is ignored and thus set to 0.
spreadFactor
The default for the third and last phase is a smoothing phase making
50 passes over the input vectors with a learning rate of 0.01 and
an initial neighbourhood size of 1. Since there is no node growth the
is ignored and thus set to 0.
spreadFactor
growthThreshold :: Phase -> Int -> DoubleSource
Calculates the growth threshold as explained in the documentation
for .
Phase
phase :: Phase -> Lattice -> Inputs -> IO LatticeSource
will update the given phase parameters inputslattice by
executing one phase of the GSOM algorithm with the given inputs
and parameters.
run :: Phases -> Lattice -> Inputs -> IO LatticeSource
Since a complete run of the GSOM algorithm means running a number of
this is usually the main function used.
Phasesrun phases lattice inputs runs the GSOM algorithm by running the
phases in the order specified, each time making passes over inputs
and using the produced to as an argument to the next phase.
The initial Lattice, Latticelattice may be constructed with the
and the newRandom functions.
newCentered
Constructors
| Bubble | The bubble kernel is essentially the identity, i.e. it has no effect. |
| Gaussian | Let
|
kernelFunction :: Kernel -> Double -> Int -> DoubleSource
Returns the kernel function associated with the given kernel.
data LearningRate Source
Constructors
| Linear Double | The linear learning rate reduction function. If you supply it with
the initial learning rate
|
| InverseAge Double | The inverse time learning rate reduction function. Given an initial
learning rate of
|
Instances