Dear expert i am asking to check my network i am using this network in structural engineering field please help me to correct

1 view (last 30 days)
dear sir i am using this first time and aspect valuable comment from you i am new in ANN , i want to use feed forward neural network in structural engineering. i make a M file using neural network function but i am facing one problem that my result is different in every successive training without changing any parameters and i also found to solve this problem. but result after simulate to test data it is not so much accurate so i how can i get better result please my network is as following and aspect valuable correction.
%%%%%modeling for Gradient Descent Error minimization Coading MLP%%%%%%%%
clear all
clc %%%%%%%%%%%%%%%%%%%%%%%Loading data%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
load='E:\Lila khatiwada\Matlab practice\Lila practice CSV file'; B=fullfile(load,'lila.csv'); sample_d=dlmread(B,',','A1..AN21');
%%%%%%%%%%%%% ANN Parameters%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sh=100;
ep=10000;
go=1e-5;
lr=0.0001;
HN1=20;
HN2=10;
ON=1; %%%%%%%%%%%ANN Data(Input parameters and Target patameters%%%%%%%%
p=sample_d(1:20,:);
t=sample_d(21,:);
%%%%%%%%%%%%%%%%%%%%Data Scalling%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[pn,psp]=mapminmax(p,0.1,.9);
[tn,pst]=mapminmax(t,0.1,.9);
TEST=10;
VAL=10;
iitst=[size(p,2)-TEST+1:size(p,2)];
iival=[size(p,2)-TEST-VAL+1:size(p,2)-TEST];
iitr=[1:size(p,2)-TEST-VAL];
val.p=pn(:,iival);
val.T=tn(:,iival);
test.p=pn(:,iitst);
test.T=tn(:,iitst);
ptr=pn(:,iitr);
ttr=tn(:,iitr);
%%%%Network Architecture%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
net=feedforwardnet([HN1 HN2]);
net.layers{1}.transferfcn='logsig';
net.layers{2}.transferfcn='logsig';
net.layers{3}.transferfcn='purelin';
net=configure(net,ptr,ttr);
% y1=net(ptr);
% plot(ptr,ttr,'o',ptr,y1,'x');
%%%%Initialize weight %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
setdemorandstream(491218382)
net=initnw(net,3);% initialize the net (weights and biases initialized)
%%%%Stopping Criteria%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
net.trainParam.goal=go; % error goal
net.trainParam.epochs=ep; % maximum iterations
net.trainParam.show=sh; % showing intervals
net.trainParam.max_fail=10; % Change this to effect the validation
net.trainParam.lr=lr;
net.trainParam.mc=0.9;
%%%%Network Training%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
net1.trainfcn='trainlm';
net1=train(net,ptr,ttr);
% y2=net(ptr);
% perf= perform(net,ttr,y2);
% plot(ptr,ttr,'+',ptr,y2,'*');
%%%%%%%%%%% Simulating%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% yp = sim(net1,test.p);
[y1,PS] = mapstd(yp);
a = mapstd('reverse',yp,PS);
  1 Comment
Greg Heath
Greg Heath on 20 Dec 2014
Of course the results are always different. You forgot to initialize the RNG to the same initial state.
Where have you calculated the ratio of mean square error to average target variance for the mixture and individual training and test subsets??

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!