KohonenSelfOrganizingMap

KohonenSelfOrganizingMap - % so we found the cluster...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% %Kohonen Self Organizing network % load ('E:\Program Files\MATLAB\R2006a\work\Neural Network\MiniProject3\nnp1.mat'); %since we know the cluster patterns we may choose the initial weights as %the cluster centers. That is: alfa0=.01; alfa=.7; tau=5; t Wk=zeros(10,100); S=y(1:100,:); Sn=.1*S; %normalized S k=1; ind=zeros(100,1); VNet=zeros(10,100); %To initailize weight matrix we are just trying to find the cluster center %of each pattern class. for i=1:10 for j=1:10 Wk(i,:)=Wk(i,:)+S(:,k)'; k=k+1; end end Wk=.1*Wk;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % so we found the cluster center. a=1; %To normalize weight matrix. for i=1:10 Wk(i,:)=Wk(i,:)/norm(Wk(i,:)); end e for epoch=1:100 for i=1:100 VNet(:,i)=Wk*S(:,i); [win(i,1),ind(i,1)]=max(VNet(:,i)); if(i==100) Wk(ind(i,1),:)=Wk(ind(i,1),:); else %ind(i+1,1)=ind(i,1)+1; %Updating weights Wk(ind(i,1),:)=Wk(ind(i,1),:)+(alfa0+alfa*exp(-epoch/tau))*(Sn(:,i)'-Wk(ind(i,1),:)); end Wk(ind(i,1),:)=Wk(ind(i,1),:)/norm(Wk(ind(i,1),:)); %Normalizing weights end end e...
View Full Document

Ask a homework question - tutors are online