|Portability||non-portable (requires STM)|
is the type of the network build by the GSOM
algorithm. This type and most of the functions dealing with it are defined
in this module.
- type Lattice = Map Coordinates (TVar Node)
- newCentered :: Int -> IO Lattice
- newRandom :: RandomGen g => g -> Int -> IO Lattice
- bmu :: Input -> Lattice -> STM Node
- grow :: Lattice -> Node -> STM (Lattice, Nodes)
- vent :: Lattice -> Node -> Double -> STM (Lattice, [Node])
- nodes :: Lattice -> STM Nodes
- putLattice :: Lattice -> IO String
- putWeights :: Lattice -> IO String
The lattice type. Since global access to nodes is needed they're
stored in a
Data.Map indexed by their coordinates.
creates a new minimal lattice where weights
are initialized with all components having the value
0.5 the and with
the weight vectors having length
creates a new minimal lattice where weights are
randomly initialized with values between 0 and 1 using the random number
newRandom g dimension
g and with the weight vectors having the specified
returns the best matching unit i.e. the node with
minimal distance to the given input vector.
bmu input lattice
will create new neighbours for every Leaf
neighbour of the given
grow lattice node
node and add the created nodes to
It will return the list of spawned nodes and the new lattice containing
every node created in the process of spawning.
will check the accumulated error
vent lattice node growthThreshold
node against the given
growthThreshold and will do nothing if
the errror value is below the growth threshhold. Otherwise it will either
spawn new nodes or it will propagate the accumulated error value to it's
neighbours, depending on whether the node is a boundary node or not.
If new nodes are spawned they will be added to
lattice and returned as
the second component of the resulting pair.