-
Notifications
You must be signed in to change notification settings - Fork 3
/
AISC-9.m.txt
51 lines (51 loc) · 774 Bytes
/
AISC-9.m.txt
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
clear all;
clc;
disp('Kohonen Self Organizing Feature Maps');
disp('The input patterns are');
x=[1 1 0 0; 0 0 0 1; 1 0 0 0; 0 0 1 1]
%x=[0.2 0.4];
t=1;
alpha(t)=0.6;
%alpha(t)=0.2;
e=1;
disp('Since we have four input pattern and cluster unit to be formed is 2, the weight
matrix is');
w=[0.2 0.8; 0.6 0.4; 0.5 0.7; 0.9 0.3]
disp('The learning rate of this epoch is');
alpha
while(e<=3);
i=1;
j=1;
k=1;
m=1;
disp('Epoch = ');
e
%while(i<=2)
while(i<=4)
for j=1:2
temp=0;
for k=1:4
%temp=temp+((w(k,j)-x(i,k)) 2);
temp=temp+((w(k,j)-x(i,k)));
end
D(j)=temp
end
if(D(1)<D(2))
J=1;
else
J=2;
end
disp('The winning unit is ');
J
disp('Weight updation ');
for m=1:4
w(m,J)=w(m,J)+(alpha(e)*(x(i,m)-w(m,J)));
end
w
i=i+1;
end
temp=alpha(e);
e=e+1;
alpha(e)=(0.5*temp);
alpha(e)
End