⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example8_2.m

📁 This complete matlab for neural network
💻 M
字号:
%随机生成1000个二维向量,作为样本,并绘出其分布
P = rands(2,1000);
plot(P(1,:),P(2,:),'+r')
title('初始随机样本点分布');
xlabel('P(1)');
ylabel('P(2)');
%建立网络,得到初始权值
net=newsom([0 1; 0 1],[5 6]);
w1_init=net.iw{1,1}
%绘出初始权值分布图
figure;
plotsom(w1_init,net.layers{1}.distances)
%分别对不同的步长,训练网络,绘出相应的权值分布图
for i=10:30:100
    net.trainParam.epochs=i;
    net=train(net,P);
    figure;
    plotsom(net.iw{1,1},net.layers{1}.distances)
end
%对于训练好的网络,选择特定的输入向量,得到网络的输出结果
p=[0.5;0.3];
a=0;
a = sim(net,p)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -