6.1: Chapter 6 Summary and a Discussion on the Neural Gas Model

Ancillary Materials for The Shallow and the Deep by M. Biehl · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC-SA 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    6.1: Chapter 6 Summary and a Discussion on the Neural Gas Model

    This is a recap of SD chapter 6, on Distance-based classifiers.

    • Sect. 6.1. Prototype-based classifiers

      1. Prototype-based algorithms use representative data points (prototypes) to model data. New data is classified by comparing it to these learned examples, similar to how K-means uses cluster centers (centroids).

      2. Learning Vector Quantization (LVQ) is one such supervised learning (classification) algorithm introduced by Teuvo Kohonen.

      3. How LVQ works:

        1. It represents classes with “prototype vectors” that are iteratively adjusted in the feature space during training. When a training sample is presented, the nearest prototype is moved closer to the sample if they share the same class label and pushed further away if their labels differ.

        2. To classify new data, it calculates the distance between the new input sample and all existing prototype vectors in the trained model. The algorithm then assigns the class label of the single closest prototype to the new data point.

        3. Note: LVQ is similar to K-means, but fundamentally they are different. LVQ is a supervised learning model, while K-means is unsupervised.

      4. Some variants incorporate neighborhood cooperation inspired by other prototype schemes like Self-Organizing Maps (SOM) or Neural Gas.

    • Sect. 6.2. Distance measures and relevance learning

      1. Beyond Euclidean Distance:

        1. Classic LVQ typically uses Euclidean distance as the similarity measure for determining the nearest prototype. This implicitly assumes isotropic distributions in data space.

        2. Modern approaches optimize or adapt the distance measure (metric learning) to better fit specific applications. E.g., use Mahalanobis distance when data is anisotropic (elongated or correlated).

      2. Adaptive Distance Measures:

        1. Adaptive or parameterized distance metrics are tuned during training to enhance discriminative power. E.g., Localized Adaptive Metrics, which assign a specific distance parameter matrix Λj to each individual prototype wj to adapt to local data distributions: $$ d_{\Lambda_j}(\mathbf{w}_j, \mathbf{\xi}) = (\mathbf{\xi} - \mathbf{w}_j)^T \Lambda_j (\mathbf{\xi} - \mathbf{w}_j).$$
          Λj is to learn from the training data. One can set Λj = ΩjTΩj to ensure Λj remains positive semi-definite.

        2. These approaches can find directions in feature space with stronger class separability.

        3. Metric adaptation is an active research area, extending LVQ’s applicability and performance in real-world tasks.

    • History of LVQ

      1. LVQ was invented by Teuvo Kohonen in the late 1980s as a supervised counterpart to vector quantization. It is related to and inspired by biological neural systems and Hebbian learning principles.

      2. LVQ served as a precursor to methods like Self-Organizing Maps (SOM) and Neural Gas. Over time, many variants and metric learning extensions have been developed, enhancing its robustness.

      3. LVQ is known for its simplicity, interpretability, and effectiveness in prototype-based classification.

    • Neural Gas (NG): The Martinetz-Schulten algorithm

      1. NG is an unsupervised NN model introduced in 1991 by Thomas Martinetz and Klaus Schulten to find optimal data representations through vector quantization. Indeed, it is designed to learn an optimal representation of a data manifold by minimizing the reconstruction error (distortion) while preserving the data’s topological structure.

      2. While it was explicitly inspired by Kohonen’s Self-Organizing Map (SOM), NG differs by using a “gas-like” dynamic where neurons distribute themselves based on distance-ranking rather than being constrained to a fixed, predefined grid like the SOM. Both algorithms are descendants of Kohonen’s LVQ, which serves as their supervised counterpart. While SOM and NG explore unlabeled data to learn underlying structures, LVQ uses labeled data to fine-tune prototype positions for specific classification tasks.

      3. In a nutshell: NG starts with a set of reference vectors (a codebook). These are the neural gas. Through a dynamical learning process (resembling a self-organizing gas), they will migrate toward data-dense regions. Concurrently, it learns the connections (edges) between close neurons, effectively learning the intrinsic topology of the data structure.

        Once the learning process is completed, the codebook vectors represent a discrete skeleton of the data, providing a foundation for data compression, cluster analysis, and accelerated vector search.

      4. The NG algorithm in details:

        Variables and Initial Values

        • W = {w1, w2, …, wN} (Codebook vectors or neurons): A set of N reference vectors initialized to random positions in the input space ℝd.

        • C (Adjacency Matrix): An N × N binary matrix initialized to 0 (Cij ∈ {0, 1}). It tracks topological connections between neurons: if Cij = 1, this means the i-th and the j-th neurons are topological neighbors.

        • T (Age Matrix): An N × N integer matrix initialized to 0, where tij stores the current age of the edge between neuron i and j.

          Note: Think of it as a dynamical score for the edges/connections (between neurons) during the learning process. As we will see, lower score is preferred: they indicate the associated edges/connections are active (while obsolete paths, with higher age scores, are no longer representing the data, and they may be deleted).

        • Parameters:

          • ϵ(t) (Learning Rate): Initialized at ϵstart (e.g., 0.5), decaying exponentially over time to ϵend (e.g., 0.01).

          • λ(t) (Neighborhood Radius): Initialized at λstart (e.g., N/2), decaying exponentially over time to λend (e.g., 0.01).

          • Tmax (Age Threshold): The maximum age an edge can reach before removal.

        The Training Loop (Iterative Learning Process)

        Select randomly an input vector v (until all data points are visited):

        • Step 1: Distance Ranking (Find the top two nearest neurons to v)

          Calculate Euclidean distances ∥v − wi∥ for all i ∈ {1, …, N}. Sort the neurons and assign a rank ki ∈ {0, 1, …, N − 1} to each neuron i, where ki = 0 is the closest (winner) and ki = N − 1 is the most distant. We will need the runner-up later.

        • Step 2: Update Reference Vectors (Shift the neural gas)

          Adapt all vectors wi using this update rule: $$ \Delta w_i = \epsilon(t) \cdot e^{-k_i / \lambda(t)} \cdot (v - w_i).$$

        • Step 3: Update Topology (Matrix C and Age T) (Learning the topology dynamically)

          Identify the winner (i0) and the runner-up (i1).

          • Connection Logic:

            If Ci0i1 = 0, set Ci0i1 = 1 to create a new edge. If Ci0i1 = 1, maintain the connection.

          • The Refresh (“keeping it fresh”)

            Always reset the age of this specific edge to zero (ti0i1 = 0).

        • Step 4: Age the Winner’s Neighbors

          For all other neurons j currently connected to the winner i0 (Ci0j = 1): increase their ages by 1 unit: $$ t_{i_0 j} = t_{i_0 j} + 1 .$$
          (the values of the C elements remain 1).

          Note: The runner-up i1 is protected from this aging because its age was reset to 0 in the previous step.

        • Step 5: Prune Obsolete Edges (removing aging connections)

          For all neighbors j of the winner i0, check the age condition:
          If $$  \text{If } t_{i_0 j} > T_{max} 
                      \text{, set } C_{i_0 j} = 0 \text{ and } C_{j i_0} = 0. $$
          Note: In the original NG, isolated neurons (not connected to other neurons) are not deleted; they remain in the gas to be potentially re-integrated later.

        • Step 6: Update Parameters

          Update the time-dependent parameters ϵ(t) and λ(t) using exponential decay.

        The Final Label/Quantization Assignment (Post-Training) Once training iterations are complete, the codebook W and adjacency matrix C are frozen for the final data representation: For every vector v in the original dataset:

        • Compute distances to all final reference vectors wi.

        • Find the index i of the absolute nearest neighbor.

        • Update Label: Set the definitive quantization label for v to i. (this is the quantization map: Q(v) = i).

      5. Applications

        Once the final codebook is fixed and every data vector has its quantization label (the index of its nearest prototype), the system is ready for high-performance downstream tasks (using these discrete representations to solve problems that were too computationally expensive with the original, high-dimensional raw data).

        1. Massive Data Compression: Replace the entire dataset of large vectors with a list of small integers (the indices).

        2. Ultrafast Vector Search and Databases: Modern vector databases use these quantized labels to perform Approximate Nearest Neighbor (ANN) searches. Instead of comparing a query vector to every single original vector, the system only compares it to the smaller set of codebook prototypes.

        3. Topological and Cluster Analysis: By examining the adjacency matrix C, one can identify sub-structures of the data (e.g., disjoint clusters).

        4. Anomaly Detection: Once the codebook is fixed, any new data vector that is “too far” from its nearest prototype (high quantization error) can be flagged as an anomaly or noise.

        5. Signal and Image Reconstruction: In multimedia applications, the final indices are transmitted over networks (not the actual data vectors). The receiver decodes it use the same codebook to reconstruct (approximately) the original signal.

    Further Exploration

    For details, readers may refer to:

    • Kohonen, T. (2001). Self-organizing maps (3rd ed.). Springer-Verlag.

    • Martinetz, T. M., & Schulten, K. J. (1991). A “neural-gas” network learns topologies. In T. Kohonen, K. Mäkisara, O. Simula, & J. Kangas (Eds.), Artificial neural networks (pp. 397–402).


    This page titled 6.1: Chapter 6 Summary and a Discussion on the Neural Gas Model was last modified on Mon, 10 Aug 2026 12:25:13 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Hei-Chi Chan.