Kristof Van Laerhoven

Parallel Implementation of

the Self Organizing Map

 

about the algorithm

the parallel implementation

the results (data & plots)

the source code

 

 

The algorithm: Self-Organizing Map (SOM)

The (Kohonen) Self-Organizing Map is an unsupervised neural network that can be used in various applications. It has only one (output) layer of neurons, that organises itself according to the inputs that are being presented. The neurons in this layer ‘compete’ for every input, but only one neuron can win (winner-take-all). The winner is found by comparing the weights of every neuron to the current input: the neuron that has the smallest (Euclidean) distance between these two vectors has won the competition. This winning neuron is allowed to adapt its weights towards the input, thus increasing the chance that it will win for a similar input in the future. The neurons in the neighbourhood of the winner are also allowed to update their weights, but in a lesser degree.

So the algorithm looks like this:

  1. Initialise the weights for every neuron to small random values
  2. present an input vector to the neural network
  3. calculate the distances between this input vector and the weights of every neuron
  4. find the minimal distance and select the corresponding neuron as the winner
  5. update the weights of the winner
  6. update the weights of the neighbours
  7. go to step 2

Kohonen SOMs are usually implemented to visualise the density of complex, multi-dimensional data, but also for clustering and classifying data and even principal component analysis. A large variety of improvements of the classic Kohonen Self-Organizing Map exist that make it an important and often-used algorithm.

References:

  1. Hertz, J., Krogh, A., and Palmer R.G. (1991) Introduction to the Theory of Neural Computation. Addison-Wesley
  2. Kohonen, T. (1989) Self-Organization and Associative Memory. Berlin: Springer-Verlag.
  3. Lau, C. (1992) Neural Networks: Theoretical Foundations and Analysis. New York IEEE Pres.

 

The parallel implementation

The architecture of the parallel algorithm was based on a master-slave structure, having one process (the master) that controls several other processes (slaves). The master sends the data for processing purposes to all slaves, which do the necessary calculations and send the results back to the master. The slaves operate independent of each other, doing the processing in parallel.

In this particular case, the master is responsible for sending the input data to the slaves, which calculate the minimal distance for a part of the output layer. The slaves send their results back to the master, where the global minimum distance is searched. The results of this search are then broadcast to the slaves, which now have sufficient information to update their weights.

Graphic representation of the Master–Slave relationship

 

Results

The measurements were done on Crunch, a machine connected to eight-processors, specifically designed for running parallel tasks. The SOM program was executed for a variable number of processors (up to nine), and a variable dimension of the problem N (= the size of the competitive layer, for 10, 20, …, till 100 ). All results are written down in microseconds.

Data:

 

1

2

3

4

5

6

7

8

9

10

2161352

2150066

2115884

2113206

2120943

2124159

2121934

2126913

2121027

20

4741880

4219178

4156103

4136166

4136104

4126065

4125797

4115973

4116042

30

8638486

7022235

6824705

6235416

6185192

6205314

6185544

6175303

6175334

40

12709632

10175308

9526375

10215483

9605677

9494908

9465284

10144660

10194616

50

17036176

13404512

12494366

13304815

12814683

11535233

11744530

13086041

12906008

60

23723316

18554728

17085576

16144367

15984935

15364797

15314744

15245085

15252537

70

28794504

22355426

20204232

19096008

18205708

18176302

18066154

17294612

17244772

80

34786008

26425256

23305644

22225258

21293934

21094284

20514480

20294966

20075008

90

41194544

30034252

26815496

25245252

24576338

23295922

23204314

22875736

22515172

100

60966148

34695220

30744500

28844580

27873820

26604352

25765864

27124630

26924932

Calculated Speed-up (T1/TN):

 

1

2

3

4

5

6

7

8

9

10

1

1,005249

1,021489

1,022783

1,019052

1,01751

1,018576

1,016192

1,019012

20

1

1,123887

1,140944

1,146443

1,146461

1,14925

1,149325

1,152068

1,152048

30

1

1,230162

1,265767

1,38539

1,39664

1,392111

1,39656

1,398876

1,398869

40

1

1,249066

1,334152

1,244154

1,323138

1,338573

1,342763

1,25284

1,2467

50

1

1,270928

1,363509

1,280452

1,329426

1,476882

1,450563

1,301859

1,320019

60

1

1,278559

1,3885

1,469449

1,484105

1,544005

1,549051

1,556129

1,555369

70

1

1,288032

1,425172

1,507881

1,58162

1,584178

1,593837

1,664941

1,669753

80

1

1,316392

1,4926

1,565157

1,633611

1,649073

1,695681

1,714021

1,732802

90

1

1,371585

1,536222

1,631774

1,676187

1,768316

1,775297

1,800796

1,829635

100

1

1,757192

1,982994

2,113608

2,187219

2,291586

2,36616

2,247631

2,264301

 

Plots of the data:

 

Source Code

Master.c

Slave.c