How to realize self-organizing competitive Neural Network by matlab
This article mainly introduces the relevant knowledge of "matlab how to realize self-organizing competitive neural network". Xiaobian shows you the operation process through actual cases. The operation method is simple, fast and practical. I hope this article "matlab how to realize self-organizing competitive neural network" can help you solve the problem.
The competitlayer function creates a competing network layer that classifies input samples based on similarity between them, with a given number of classes, and always tends to assign the same number of samples to each class, classifying as evenly as possible.
inputs = iris_dataset;
% Load Data
net = competlayer(3);
% Create Competitive Network
net = train(net,inputs);
% Training
outputs = net(inputs);
% classification
classes = vec2ind(outputs);
% format conversion. classes for classification results
The selforgemap function clusters data using similarities and topology of the data itself.
x = simplecluster_dataset;
figure
plot(x(1,:),x(2,:),'o')
set(gcf,'color','w')
title ('raw data')
net = selforgmap([8 8]);
% Create Self-Organizing Mapping Network
net = train(net,x);
% Training
y = net(x);
classes = vec2ind(y);
figure
hist(classes,64)
% Show cluster results
set(gcf,'color','w')
title ('Cluster results')
xlabel ('Category ')
ylabel ('Number of samples contained in category')
figure
plotsompos(net,x)
% Show the location of the category center point
net = selforgmap([2,3]);
net = train(net,x);
y = net(x);
classes = vec2ind(y);
figure
hist(classes,6)
Number of samples in % 6 categories
figure
plotsomhits(net,x)
% shows the number of each category
figure
plotsompos(net,x)
% Show the location of the category center point
Data files are MATLAB's own data for clustering
About "matlab how to achieve self-organizing competitive neural network" content introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the industry information channel. Xiaobian will update different knowledge points for you every day.