Neural Network Toolbox Previous page   Next Page

Creating a Self-Organizing MAP Neural Network (newsom)

You can create a new SOFM network with the function newsom. This function defines variables used in two phases of learning:

These values are used for training and adapting.

Consider the following example.

Suppose that we want to create a network having input vectors with two elements that fall in the range 0 to 2 and 0 to 1 respectively. Further suppose that we want to have six neurons in a hexagonal 2-by-3 network. The code to obtain this network is

Suppose also that the vectors to train on are

We can plot all of this with

to give

The various training vectors are seen as fuzzy gray spots around the perimeter of this figure. The initialization for newsom is midpoint. Thus, the initial network neurons are all concentrated at the black spot at (1, 0.5).

When simulating a network, the negative distances between each neuron's weight vector and the input vector are calculated (negdist) to get the weighted inputs. The weighted inputs are also the net inputs (netsum). The net inputs compete (compete) so that only the neuron with the most positive net input will output a 1.


Previous page  Architecture Training (learnsom) Next page

© 1994-2005 The MathWorks, Inc.