www.gusucode.com > som-bp混合神经网络的matlab程序源码 > matlab_emulator/SOM_00.m

    %------  SOM test --------
clear
clc
echo off
% --------------- initial the parameter
out_num = 2;                  % 输出节点数目
input_num = 7;                % 输入节点数目
Epochs = 100;                  % 训练周期
% --------------- read data from the file
base_path = 'E:\SOMBP\data_source\feature02\';
I1 = load([base_path,'apen.txt']);           % 1 >> 2        1.2563    1.8150        
I2 = load([base_path,'kc.txt']);             % 0 >> 1        0.6299    0.9611
I3 = load([base_path,'mir.txt']);            % 0 >> 5        0.4802    4.0544
I4 = load([base_path,'asm.txt']);            % 0 >> 0.01    0.0004    0.0037
I5 = load([base_path,'idm.txt']);            % 0 >> 0.5       0.0663    0.2906
% I1 = load([base_path,'apen2.txt']);
% I2 = load([base_path,'kc2.txt']);
% I3 = load([base_path,'mir2.txt']);
% I4 = load([base_path,'asm2.txt']);
% I5 = load([base_path,'idm2.txt']);

P = [I1';I2';I3';I4';I5'];
MinMaxValue = minmax(P);

% NEWSOM ---- create the som net
net = newsom( MinMaxValue,[out_num]);
net.trainParam.epochs = Epochs;

% TRAIN ----- train the net
begin_time = clock;
[net,tr,Y,E,Pf,Af] = train(net,P);
cost_time = etime(clock,begin_time)

% OOTPUT ----- out put the som data which made as the bp input data
SOMresult = net.IW{1}*P;
save SOMresult.mat SOMresult;