Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the data Classification of SOM Neural Network by matlab

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to realize the data classification of SOM neural network by matlab". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Self-organizing feature map neural network (SOM) learns and classifies according to the grouping of input vectors in the input space.

In the SOM network, the neurons in the competition layer try to identify the part of the input space adjacent to the neuron, that is to say, the SOM neural network can learn not only the distribution characteristics of the training data input vector, but also the topology of the training data input vector. An important feature related to the SOM topological sorting feature is that each neuron is also associated with its nearest neighbor neuron. In the process of weight updating, not only the weight vector of the winning neuron is updated, but also the weight vector of its nearest neighbor neuron is updated according to a "nearest neighbor function", so that the amount of movement at the beginning is very large, and the weight vector can be roughly sorted according to their final position. Finally, only a single weight vector is moved (fine-tuning), which forms a special classification, and the discretionary vectors are ordered in such a way that they represent input vectors on a "elastic" grid. If there is a change in a certain position of the grid, then the change will affect the nearest neighbor of the secondary neuron, but the farther away from the neuron, the smaller the effect, so in the evolution of the position of the neuron in the competitive layer, each region represents a class of input vectors.

In other words, several value vectors are used to represent a data set (input vector), and each weight phasor represents the mean of a certain type of input vector.

Through training, such a layout can be established so that each weight vector is located in the center of input vector clustering. Once SOM completes training, it can be used to cluster training data or other data.

% clear environment variables

Clc

Clear

% enter input data

% load data

Load p

% is in accordance with the input format of neural network after transpose.

Please P'

%% Network Establishment and training

Establish SOM network with 36 neurons in the competitive layer

Net=selforgmap ([6 6])

Plotsom (net.layers {1} .positions)

Steps of 5 training sessions

A = [10 30 50 100 200 500 1000]

% randomly initialize a 1-10 vector.

Yc=rands (7 and 8)

%% for training

% the number of training is 10

Net.trainparam.epochs=a (1)

% training networks and viewing categories

Net=train (net,P)

Y=sim (net,P)

Yc (1m:) = vec2ind (y)

Plotsom (net.IW {1, net.layers {1} .distances)

%% the number of training is 30

Net.trainparam.epochs=a (2)

% training networks and viewing categories

Net=train (net,P)

Y=sim (net,P)

Yc (2m:) = vec2ind (y)

Plotsom (net.IW {1, net.layers {1} .distances)

%% training times is 50 times

Net.trainparam.epochs=a (3)

% training networks and viewing categories

Net=train (net,P)

Y=sim (net,P)

Yc (3Jing:) = vec2ind (y)

Plotsom (net.IW {1, net.layers {1} .distances)

%% the number of training is 100

Net.trainparam.epochs=a (4)

% training networks and viewing categories

Net=train (net,P)

Y=sim (net,P)

Yc (4Jing:) = vec2ind (y)

Plotsom (net.IW {1, net.layers {1} .distances)

%% the number of training is 200.

Net.trainparam.epochs=a (5)

% training networks and viewing categories

Net=train (net,P)

Y=sim (net,P)

Yc (5dint:) = vec2ind (y)

Plotsom (net.IW {1, net.layers {1} .distances)

%% the number of training is 500.

Net.trainparam.epochs=a (6)

% training networks and viewing categories

Net=train (net,P)

Y=sim (net,P)

Yc (6Jing:) = vec2ind (y)

Plotsom (net.IW {1, net.layers {1} .distances)

%% the number of training is 1000

Net.trainparam.epochs=a (7)

% training networks and viewing categories

Net=train (net,P)

Y=sim (net,P)

Yc (7):) = vec2ind (y)

Plotsom (net.IW {1, net.layers {1} .distances)

Yc

%% network for classified prediction

% Test sample input

T = [0.9512 1.0000 0.9458-0.4215 0.4218 0.9511 0.9645 0.8941]'

% sim () to do network simulation

R=sim (net,t)

The% transform function converts a single-valued vector into a subscript vector.

Rr=vec2ind (r)

%% distribution of network neurons

View Network Topology structure

Plotsomtop (net)

% to view the direct distance of neighboring neurons

Plotsomnd (net)

% View the classification of each neuron

Plotsomhits (net,P)

This is the end of the content of "how to realize the data classification of SOM neural network by matlab". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report