-
Notifications
You must be signed in to change notification settings - Fork 1
/
somCreate.m
30 lines (22 loc) · 878 Bytes
/
somCreate.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function somCreate(minMax,gridSize)
global neuronsPerRow neuronsPerColumn N IW distances dimensions positions;
neuronsPerRow = gridSize(1,1);
neuronsPerColumn = gridSize(1,2);
N = neuronsPerRow*neuronsPerColumn;
minFeatureValues = minMax(:,1)';
maxFeatureValues = minMax(:,2)';
dimensions = size(minMax,1);
IW = zeros(N,dimensions);
for i = 1:N,
IW(i,:) = rand(1,dimensions).*(maxFeatureValues-minFeatureValues)+minFeatureValues;
end
% positions = hexagonalTopology(neuronsPerRow,neuronsPerColumn);
% positions = gridtop(neuronsPerRow,neuronsPerColumn);
positions = hextop(neuronsPerRow,neuronsPerColumn);
% positions = randtop(neuronsPerRow,neuronsPerColumn);
% distances = boxdist(positions);
% distances = dist(positions);
% distances = linkdist(positions);
distances = mandist(positions);
%%%%%%%%%%%%
%distances = ring_distances(N);