Skip to main content
. 2022 Dec 8;22(24):9621. doi: 10.3390/s22249621
Algorithm 1 Training process of self-organizing mapping neural network (SOM)
  • Input: 

    The normalized traffic condition sample X.

  • Output: 

    The well-trained SOM network.

  • 1:

    Initializing and normalize weight W, Wj,j=1,...,Class; initial neighborhood radius fneighbor(1)=n0=3; initial learning rate flearn(1)=l0=0.1; initial max iterations MaxIter and iterations Iter.

  • 2:

    whileIter < MaxIter do

  • 3:

       for i = 1 to T×N do

  • 4:

         Choose the traffic condition sample xiX.

  • 5:

         for j = 1 to Class do

  • 6:

            Calculate the Euclidean distance and select the nearest winning node.

            dij(x)=(xiwj)2

  • 7:

            for K = 1 to fneighbor(1) do

  • 8:

              Update the weight of the winning node and the neighbor nodes.

              wk=wk+flearn(iter)×fneighbor(iter)×(xiwk)

  • 9:

              Update the number of iteration, learning rate, and neighborhood radius function.

              fneighbor(Iter+1)=n0×exp(Iter/t1),

              t1=MaxIter/log(n0)

              flearn(Iter+1)=l0×exp(Iter/t2),

              t2=MaxIter

              Iter=Iter+1

  • 10:

            end for

  • 11:

         end for

  • 12:

       end for

  • 13:

    end while