Neural Network Toolbox | ![]() ![]() |
Topologies (gridtop, hextop, randtop)
You can specify different topologies for the original neuron locations with the functions gridtop
, hextop
or randtop
.
The gridtop
topology starts with neurons in a rectangular grid similar to that shown in the previous figure. For example, suppose that you want a 2 by 3 array of six neurons You can get this with:
pos = gridtop(2,3) pos = 0 1 0 1 0 1 0 0 1 1 2 2
Here neuron 1 has the position (0,0); neuron 2 has the position (1,0); neuron 3 had the position (0,1); etc.
Note that had we asked for a gridtop
with the arguments reversed we would have gotten a slightly different arrangement.
pos = gridtop(3,2) pos = 0 1 2 0 1 2 0 0 0 1 1 1
An 8-by-10 set of neurons in a gridtop topology can be created and plotted with the code shown below
pos = gridtop(8,10); plotsom(pos)
As shown, the neurons in the gridtop topology do indeed lie on a grid.
The hextop
function creates a similar set of neurons, but they are in a hexagonal pattern. A 2-by-3 pattern of hextop
neurons is generated as follows:
pos = hextop(2,3) pos = 0 1.0000 0.5000 1.5000 0 1.0000 0 0 0.8660 0.8660 1.7321 1.7321
Note that hextop
is the default pattern for SOFM networks generated with newsom
.
An 8-by-10 set of neurons in a hextop topology can be created and plotted with the code shown below.
pos = hextop(8,10); plotsom(pos)
Note the positions of the neurons in a hexagonal arrangement.
Finally, the randtop
function creates neurons in an N dimensional random pattern. The following code generates a random pattern of neurons.
pos = randtop(2,3) pos = 0 0.7787 0.4390 1.0657 0.1470 0.9070 0 0.1925 0.6476 0.9106 1.6490 1.4027
An 8-by-10 set of neurons in a randtop topology can be created and plotted with the code shown below
pos = randtop(8,10); plotsom(pos)
For examples, see the help for these topology functions.
![]() | Self-Organizing Maps | Distance Funct. (dist, linkdist, mandist, boxdist) | ![]() |