Basic self-organizing map implementation.
This module contains the following Kohonen map implementations:
- Map. A standard rectangular N-dimensional Kohonen map.
- Gas. A vector quantizer that does not have a fixed topology. Neurons in a gas are sorted for updates based on their distance from the cue, with the sort order defining a topology for each cue presentation.
- GrowingGas. A Gas-based quantizer that can add neurons dynamically to explain high-error areas of the input space.
- Filter. A wrapper over an underlying Map instance that maintains an explicit estimate of the likelihood of each neuron.
These are tested using the kohonen_test.py file in this source distribution.
Because they have a grid topology, Map objects have some cool visualization options, including Map.neuron_colormap and Map.distance_heatmap. These require the Python Image Library.
There is also a collection of distance metrics:
- cosine_metric. A callable that calculates the cosine distance between a cue and each neuron in a Kohonen Map.
- euclidean_metric. A callable that calculates the Euclidean distance between a cue and each neuron in a Kohonen Map.
- manhattan_metric. A callable that calculates the Manhattan distance between a cue and each neuron in a Kohonen Map.
There are also some small utility classes for modeling time series values:
- Timeseries. A callable that takes no arguments and returns a value that might vary over time. Each call to the function will generally return a unique value (though this is not necessary).
- ExponentialTimeseries. A callable that takes no arguments and returns an exponentially decreasing (or increasing) series of values, dependent on the parameters passed in at construction time.
- etc.
These distance functions and time series objects are generally used to regulate the learning parameters in Kohonen Map objects.
kohonen.kohonen.Timeseries() | Represents some sort of value that changes over time. |
kohonen.kohonen.ConstantTimeseries([k]) | This timeseries just returns a constant value. |
kohonen.kohonen.LinearTimeseries | |
kohonen.kohonen.ExponentialTimeseries([...]) | Represents an exponential decay process. |
kohonen.kohonen.Parameters([dimension, ...]) | We are plain old data holding self-organizing map parameters. |
kohonen.kohonen.GrowingGasParameters([...]) | Parameters for Growing Neural Gases. |
kohonen.kohonen.Map(params) | Basic implementation of a rectangular N-dimensional self-organizing map. |
kohonen.kohonen.Gas(params) | A neural Gas is a topologically unordered collection of neurons. |
kohonen.kohonen.GrowingGas(params) | A Growing Neural Gas uses a variable number of variable-topology neurons. |
kohonen.kohonen.Filter(map[, history]) | A Filter is an estimate of the probability density of the inputs. |