algorithmmachine-learningself-organizing-maps

Is the location of a neuron in a Self-Organizing Map dependent on its weight?


I've looked at a lot of theoretical examples of SOMs, but one thing is not really clear to me: is the location of nodes dependent on their weights? For example, will nodes with a larger weight be on one side of the map, while nodes with a smaller weight will be further away on the map?


Solution

  • No. In an SOM (aka Kohonen Map) the weight function is applied to your data not the the "Neurons".

    Weights are used during map construction (training), i.e., calculated at each iteration and for each lattice cell within each iteration. Put another way, for each iteration that comprises map construction, a weight function is used to scale the contribution of those points in determining the cell's position/location.

    A data point's location in a Kohonen Map is determined by the lattice cell in the map closest to that data point--i.e., building a Kohonen Map involves iterative re-assignment of each point in your data set to the cell in the lattice closest to it.

    Here's one way to think of it: A Kohonen Map is just a mapping of your data onto some fixed topology, or lattice, in 2 dimensions, a regular grid for instance.

    Each iteration in the training phase (building the map) involves a re-assignment of each data point (if necessary) to the closest cell in the lattice closest to it. Next, the cell positions are adjusted based on (i) the data points assigned to that cell from the prior iteration; and (ii) the data points in the neighboring cells.

    How the values of the data points in (i) and (ii) contribute to the new value of the cell location is determined by each data point's weight, which is in turn determined by a weight function. This is consistent with intuition--points further from the cell should have a smaller influence on the cell's new value compared with data points closer to the cell. In a Kohonen Map, the weight function enforces this constraint. The textbook weight function is Gaussian. In Python:

    def gaussian(dist, t, alpha=1.0, sigma=1.0) :
        from math, import e
        return alpha * t * e**(-dist/(2*sigma*t))**2
    

    In this function, dist is the distance of the data point from the cell center, and t is time (e.g., each iteration during map building is one tick of the clock).

    So imagine a Gaussian curve, cut in half down its center; the x axis is dist and the y axis represents weight--so as distance increases, the weight decreases. Likewise, as t increases, so does weight. This a crucial element in building Kohonen Map: with increasing iterations (during map building) the neighboring points have less and less influence on the re-positioning of a given cell. Therefore, the significance of the time-weight relationship is that the rate of change in cell positions decreases over time (positions change less with each iteration), until eventually the is no change in position with the next iteration which is the convergence criterion for a Kohonen Map.

    What does the data point's weight have to do with this? Well, the location of that lattice cell in the prior iteration was determined by the data points in that cell and those in the neighboring cell, the contributions of those points to the new cell's position are determined according to a weighting function.

    Finally, a data point's weight is not really an inherent attribute of that data point. For one thing, it's useful only during map construction, and for another a data points doesn't actually have a weight value--rather in each iteration during map construction, the data points assigned to a given cell and those points in neighboring cells are used to compute the new position of a given lattice cell. That computation takes into account the distance of each point from the cell center by assigning a weight to each data point--hence, that weight value is only meaningful for that iteration and for that cell center, e.g., in calculating the next cell center, the same data point will have a different weight because it's distance to that cell center is different.