Link distance function
Syntax
d = linkdist(pos)
Description
linkdist is a layer distance function used to find the distances between the layer's neurons given their positions.
linkdist(pos) takes one argument,
and returns the S x S matrix of distances.
Examples
Here we define a random matrix of positions for 10 neurons arranged in three dimensional space and find their distances.
pos = rand(3,10);
D = linkdist(pos)
Network Use
You can create a standard network that uses linkdist as a distance function by calling newsom.
To change a network so that a layer's topology uses linkdist, set net.layers{i}.distanceFcn to 'linkdist'.
In either case, call sim to simulate the network with dist. See newsom for training and adaption examples.
Algorithm
The link distance D between two position vectors Pi and Pj from a set of S vectors is:
Dij = 0, if i==j
= 1, if (sum((Pi-Pj).^2)).^0.5 is <= 1
= 2, if k exists, Dik = Dkj = 1
= 3, if k1, k2 exist, Dik1 = Dk1k2 = Dk2j = 1.
= N, if k1..kN exist, Dik1 = Dk1k2 = ...= DkNj = 1
= S, if none of the above conditions apply.
See Also
sim, dist, mandist
[ Previous | Help Desk | Next ]