Algorithm 1. A pseudocode for the construction of the inter-phase and intra-phase SOM. | |
---|---|
1 | Generate a random weight vector for each node in the 3x3 SOM. |
2 | Select a random feature vector as the input vector . |
3 | Calculate the Euclidean distance between the input vector and the weight vector. |
4 | Identify the node with the smallest Euclidean distance as the BMU. |
5 | Update the weight vector according to (1). |
6 | Repeat Steps 2–5 until the maximum number of iterations is met or until the grid shrinks (i.e., the weights converge to local minima). |