亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? nnmodel.asv

?? 人工神經(jīng)網(wǎng)絡:MATLAB源程序用于訓練測試
?? ASV
?? 第 1 頁 / 共 3 頁
字號:
%#											
%# function [w1f,w2f,tablein,tableout] = nnmodel(topo,xtrain,ytrain,xmon,ymon,xtest,
%#	   					ytest,epochs,trials,setseed)	
%#										
%# AIM:	Backpropagation neural network with one hidden layer for multivariate
%#		calibration. (Designed to model only one response y at a time)	
%#										
%# PRINCIPLE:	The neural network is trained with the Levenberg-Marquardt algorithm.
%#		The activation functions can be either linear ('L') or hyperbolic
%#		tangent ('H'). The network has one hidden layer. The network topology 
%#		is determined by the matrix 'topo', which has two rows : one for
%#		specifying the hidden layer and one for the output layer.	
%#		Example: topo = ['HHHH';'L---'] defines a network with 4 nodes in the 
%#		hidden layer (hyperbolic tangent transfer functions) and one node in
%#		the output layer (linear transfer function). A weight can be pruned by
%#		setting it to zero. The bias is automatically included as the last
%#		column of the weight matrices. The model is built with the training
%#		set, but a monitoring set is necessary to avoid overtraining.
%#									
%#		At the end of training, a menu is available to summarize results 
%#		(training, monitoring and test if available). Statistical estimations
%#		are obtained using the solution with monitoring error closest to the 
%#		median (over all replicate training runs performed).
%#										
%#		A diagnostic is performed to assess the sensitivity (influence) of each 
%#		input variable and hidden node in the model. Maps of projections of the
%# 		training samples on hidden nodes allow to visualize clusters and 
%#		outliers. Deviations from linearity are calculated for each hidden node	
%#		in order to estimate the degree of nonlinearity of a data set.	
%#		Input variables with lowest sensitivities should be removed and the 
%#		neural network re-trained. 					 
%#									
%# REFERENCE:	"Tutorial Review: Neural Networks in Multivariate Calibration"	
%#		         F.Despagne, D.L.Massart, Analyst 123 (1998) 157R-178R		
%# 										
%# INPUT:	topo (2 x nh) : Matrix containing structure of the NN (nh hidden nodes)
%#			        (H: hyperbolic tangent, L: linear, -: no node)	
%#		    xtrain (ntr x p) : Matrix of training inputs (ntr objects, p variables)
%#		    ytrain (ntr x 1) : Vector of training responses			
%#		    xmon   (nm x p) : Matrix of monitoring inputs (nm objects, p variables)
%#		    ymon   (nm x 1) : Vector of monitoring responses		
%#		    xtest  (nte x p) : Matrix of test inputs (if not available, enter [])
%#		    ytest  (nte x 1) : Vector of test responses (if not available, enter [])
%#		    epochs : Maximum number of epochs (iterations) for the training	
%#		    trials : Number of trials. If trials>1, several trials are performed
%#			   with the same topology but different initial random weights.
%#			   In this case, average results are reported.		
%#		    setseed : Seed for generating initial random weights.	
%#			  (Optional. Only valid if trials=1. Default: random seed)							
%#									
%# OUTPUT:	w1f (nh x (p+1)) : matrix of weights between input and hidden layer
%#              		   corresponding to the trial with monitoring error closest to the median.
%#				   		
%#		    w2f (1 x (nh+1)) : matrix of weights between hidden and output layer 
%#              		   corresponding to the trial with monitoring error closest to the median.
%#				   			
%#		    tablein (mxtr x 2):input range-scaling parameters.	
%#		    tableout (1 x 2):  output range-scaling parameters.	
%# 										
%# SUBROUTINES: range.m : range-scaling of training, monitoring and test data
%#		        levmarq.m : training of the network with Levenberg-Marquardt	
%#		        lmeval.m : estimation of responses with the final neural network model
%#		        invrange.m : returns range-scaled data to original scale	
%#		        rms.m : calculates root mean squared error		
%#		        corrplot.m : draws correlation plot			
%#		        drawnn.m : draws the neural network structure		
%#		        linfit.m : builds univariate linear regression model		
%#		        kolnorm.m : Kolmogorov-Smirnov test to check if replicate y-predicted 
%#			              values are normally distributed.		
%#										
%# AUTHOR:	Frederic Despagne					
%#		Copyright(c) 1997 for ChemoAC					
%#		Dienst FABI, Vrije Universiteit Brussel			
%#		Laarbeeklaan 103, 1090 Jette			
%#									
%# VERSION: 1.1 (28/01/1999)				
%#									
%# TEST:									
%#										

function [w1f,w2f,tablein,tableout] = nnmodel(topo,xtrain,ytrain,xmon,ymon,xtest,ytest,epochs,trials,setseed)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INITIALIZATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Test to check if all necessary input variables are available
if nargin < 9		
	error('Some input arguments are missing.')
end

% Test to check that only one trial is performed with the defined random number generator seed
if nargin == 10
	if trials ~= 1
		error('The "setseed" input variable is only valid if "trials" is set to 1.')
	end
end

% Test to check if a test set is available
if isempty(xtest)
	testflag = 0;		
else
	testflag = 1;
end  

[nxtr,mxtr] = size(xtrain);	   % Size of the training input data
[ndef,mdef] = size(topo);	   % Topology of the network
nxm = size(xmon,1);		       % Number of monitoring samples
nxte = size(xtest,1);		   % Number of test samples
init = 1/(1*mxtr);  		   % Determination of weights initialization range
periodisp = ceil(epochs/10);   % Determination of the periodicity of display
indisp = zeros(1,trials);	% Vector containing optimum number of epochs, initialization
partyh = zeros(mdef,nxtr);	% Matrix of partial responses with one hidden node, training set
w1in = [];
w2in = [];
w1fin = [];			% The matrix where replicate sets of weights input-hidden will be stored
w2fin = [];			% The matrix where replicate sets of weights hidden-output will be stored
conctrx = [];			% Matrix of partial responses with one input variable, training set, first iteration 
concytrhat = [];		% Matrix of replicate predicted y-values with partial models, training set
setfig = [312 288 560 420];	% Vector of position indices for figure display
periodisp = [];


%%%%%%%%%%%%%%%%%%%%%%%%%% SCALING OF INPUT AND OUTPUT DATA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tic
for i = 1:mxtr

	% Range-scaling of training and monitoring input data between -1 and 1
	[xtra(:,i),tablein(i,:),xmonit(:,i)] = range(xtrain(:,i),-1,1,xmon(:,i));

	% Range-scaling of test input data between -1 and 1	
	if testflag		
		[xtra(:,i),tablein(i,:),xtes(:,i)] = range(xtrain(:,i),-1,1,xtest(:,i));
	end
end

% Range-scaling of training and monitoring output data between 0.2 and 0.8
[ytra,tableout,ymonit] = range(ytrain,0.2,0.8,ymon);

xtr = xtra'; ytr = ytra';	% Transposition of training input and output data	
xm = xmonit'; ym = ymonit';	% Transposition of monitoring input and output data


if testflag

	% Range-scaling of test output data between 0.2 and 0.8
	[ytra,tableout,ytes] = range(ytrain,0.2,0.8,ytest);

	xte = xtes'; yte = ytes';	% Transposition of test input and output data
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NETWORK INITIALIZATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

for nit = 1:trials			% Loop on the number of trials
	close
	clc
	disp(' ')

	% Set the random number generator seed
	if nargin == 10
		randseed = setseed;
	else
		t0 = clock;			% The clock parameters vector
		randseed = 210610+100*nit;	% sum(100*t0(:,1:6)) A number that changes every second, as a seed to generate random weights
	end
	rseed(nit) = randseed;
	rand('seed',randseed);			% Random generator seed set on the clock

	w10 = rand(mdef,mxtr+1);		% Generation of the first matrix of random weights
	w20 = rand(1,mdef+1);			% Generation of the second matrix of random weights
	[w1,w1tab] = range(w10,-init,+init);	% Weights scaled to the initialization range
	[w2,w2tab] = range(w20,-init,+init);	% Weights scaled to the initialization range


%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRAINING AND PREDICTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	% Training of the network. The monitoring set is used to stop the training
	[w1f,w2f,indisp(nit)] = levmarq(topo,w1,w2,xtr,ytr,xm,ym,epochs,periodisp);

	w1in = [w1in;w1];	% The replicate initial w1 matrices are accumulated
	w2in = [w2in;w2];	% The replicate initial w2 matrices are accumulated
	w1fin = [w1fin;w1f];	% The replicate final w1 matrices are accumulated
	w2fin = [w2fin;w2f];	% The replicate final w2 matrices are accumulated

	% Estimation of training responses
	[ytr1,ytr2,intr1,intr2] = lmeval(topo,w1f,w2f,xtr);

	% Inverse-scaling of estimated training responses
	ytrhat(nit,:) = invrange(ytr2,0.2,0.8,tableout);

	% Determination of root mean squared error of calibration
	rmstra(nit) = rms(ytrain,ytrhat(nit,:)');

	% Estimation of monitoring responses
	[ymon1,ymon2,inmon1,inmon2] = lmeval(topo,w1f,w2f,xm);

	% Inverse-scaling of estimated monitoring responses
	ymonhat(nit,:) = invrange(ymon2,0.2,0.8,tableout);

	% Determination of root mean squared error of prediction (monitoring set)
	rmsmon(nit) = rms(ymon,ymonhat(nit,:)');

	if testflag

		% Estimation of the test responses
		[ytes1,ytes2,intes1,intes2] = lmeval(topo,w1f,w2f,xte);

		% Inverse-scaling of estimated test responses
		yteshat(nit,:) = invrange(ytes2,0.2,0.8,tableout);

		% Determination of root mean squared error of prediction (test set)
		rmstest(nit) = rms(ytest,yteshat(nit,:)');
	end

end
toc
%%%%%%%%%%%%%%%%%%%%%%%%%%% DETERMINATION OF THE REFERENCE TRIAL (MEDIAN RMSEM) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

medrmsmon = median(rmsmon);			% Determination of the RMSEM median
diffmedian = abs(rmsmon-medrmsmon);		% All RMSEM values are compared to the median
[indiffref,sortind] = sort(diffmedian);		% The RMSEM values are sorted according to their distance to the median
indref = sortind(1);				% The index of the reference trial (closest to the median) is found		
retainw1 = 1+(indref-1)*mdef;			% Indices of lines corresponding to the reference trial in w1fin
w1inref = w1in(retainw1:retainw1+mdef-1,:);	% The initial w1 weight matrix for the reference trial
w2inref = w2in(indref,:);			% The initial w2 weight matrix for the reference trial
w1ref = w1fin(retainw1:retainw1+mdef-1,:);	% The final w1 weight matrix for the reference trial
w2ref = w2fin(indref,:);			% The final w2 weight matrix for the reference trial
clear w1fin w2fin w1in w2in

% Estimation of training responses
[ytr1,ytr2,intr1,intr2] = lmeval(topo,w1ref,w2ref,xtr);

% Inverse-scaling of estimated training responses
ytrref = invrange(ytr2,0.2,0.8,tableout);

% Determination of root mean squared error of calibration
rmstraref = rms(ytrain,ytrref');

% Estimation of monitoring responses
[ymon1,ymon2,inmon1,inmon2] = lmeval(topo,w1ref,w2ref,xm);

% Inverse-scaling of estimated monitoring responses
ymonref = invrange(ymon2,0.2,0.8,tableout);

% Determination of root mean squared error of prediction (monitoring set)
rmsmonref = rms(ymon,ymonref');

if testflag

	% Estimation of the test responses
	[ytes1,ytes2,intes1,intes2] = lmeval(topo,w1ref,w2ref,xte);

	% Inverse-scaling of estimated test responses
	ytesref = invrange(ytes2,0.2,0.8,tableout);

	% Determination of root mean squared error of prediction (test set)
	rmstestref = rms(ytest,ytesref');
end

residtrain = ytrain-ytrref';		% training set residuals for the reference trial
residmon = ymon-ymonref';		% Monitoring set residuals for the reference trial
mrmstra = mean(rmstra); 		% Determination of average RMSEC on retained trials	
stdtra = std(rmstra);			% Standard deviation of RMSEC on retained trials
mrmsmon = mean(rmsmon);			% Determination of average RMSEM on retained trials
stdmon = std(rmsmon);			% Standard deviation of RMSEM on retained trials

if testflag
	residtest = ytest-ytesref';	% Test set residuals for the reference trial	
	mrmstest = mean(rmstest);	% Determination of average RMSEP on retained trials
	stdtest = std(rmstest);		% Standard deviation of RMSEP on retained trials
end


%%%%%%% ESTIMATION OF INPUT VARIABLES SENSITIVITIES BY PARTIAL MODELING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

for i = 1:mxtr
	xtrunc = 0*xtr;		% All training input variables but one
	xtrunc(i,:) = xtr(i,:);	% are set to 0

	% Training of the network. The monitoring set is used to stop the training
	[w1n,w2n] = levmarq(topo,w1inref,w2inref,xtr,ytr,xm,ym,epochs,[]);

	% Estimation of training responses using only one input in the model
	[ytrunc1,ytrunc2] = lmeval(topo,w1n,w2n,xtrunc);
	
	% Inverse-scaling of training responses estimated using one input only
	ytrunchat = invrange(ytrunc2,0.2,0.8,tableout);
	concyhtr(i,:) = ytrunchat;
		
	
	xtruncm = 0*xm;		% All monitoring input variables but one
	xtruncm(i,:) =xm(i,:);	% are set to 0

	% Estimation of monitoring responses using only one input in the model
	[ytruncm1,ytruncm2] = lmeval(topo,w1n,w2n,xtruncm);

	% Inverse-scaling of monitoring responses estimated using one input only
	ytruncmhat = invrange(ytruncm2,0.2,0.8,tableout);
	concymhat(i,:) = ytruncmhat;

	% Determination of variance of the predicted training responses without noise
	varytrunc0(1,i) = cov(ytrunchat);

	if testflag
		xtrunct = 0*xte;	% All test input variables but one
		xtrunct(i,:) = xte(i,:);% are set to 0	

		% Estimation of test responses using only one input in the model
		[ytrunct1,ytrunct2] = lmeval(topo,w1n,w2n,xtrunct);
		
		% Inverse-scaling of test responses estimated using one input only
		ytruncthat = invrange(ytrunct2,0.2,0.8,tableout);
		concyteshat(i,:) = ytruncthat;
	end
end

% The sensitivity of each input variable is the scaled variance of the training
% responses estimated using this variable only
varytrunc = 100*(varytrunc0./sum(varytrunc0));			


%%%%%%% ESTIMATION OF HIDDEN NODES SENSITIVITIES BY PARTIAL MODELING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 			
for i = 1:mdef
	w2trunc = 0*w2ref;				% All hidden nodes but one

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本不卡视频在线| 在线播放欧美女士性生活| 欧美三级日韩三级| 久久久久久夜精品精品免费| 一区二区三区成人| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 7878成人国产在线观看| 中文在线资源观看网站视频免费不卡| 日韩av不卡在线观看| 色哟哟一区二区三区| 国产精品嫩草久久久久| 国产麻豆欧美日韩一区| 日韩欧美一级特黄在线播放| 亚洲不卡av一区二区三区| 色综合久久久久久久久| 中文字幕中文在线不卡住| 国产成人在线电影| 26uuu国产一区二区三区| 免费成人在线播放| 欧美另类变人与禽xxxxx| 亚洲午夜激情av| 在线这里只有精品| 亚洲一区二区三区视频在线播放| 91色乱码一区二区三区| 亚洲色图欧美偷拍| 91影院在线观看| 亚洲精品一二三| 色综合视频一区二区三区高清| 亚洲日本中文字幕区| 99九九99九九九视频精品| 中文字幕一区二区三区四区| 成人av网在线| 亚洲精品v日韩精品| 欧美综合色免费| 偷拍自拍另类欧美| 51精品久久久久久久蜜臀| 蜜臀精品久久久久久蜜臀| 日韩午夜av电影| 激情国产一区二区| 国产欧美久久久精品影院| 不卡的av电影| 一区二区三区91| 欧美日韩一区二区在线观看| 免费成人美女在线观看.| 久久先锋影音av鲁色资源网| 国产剧情一区在线| 亚洲色图第一区| 91精品国产综合久久蜜臀 | 国产精品国产成人国产三级 | 亚洲精品日产精品乱码不卡| 欧美亚洲日本一区| 美女视频网站黄色亚洲| 国产欧美一区二区在线| 色素色在线综合| 免费人成网站在线观看欧美高清| 久久综合九色欧美综合狠狠| 99精品久久免费看蜜臀剧情介绍| 一区二区在线免费| 日韩免费视频一区| av日韩在线网站| 日韩1区2区日韩1区2区| 中文字幕免费不卡| 91麻豆精品国产91久久久久 | 日本欧美一区二区| 日本一区二区三区免费乱视频| 色偷偷88欧美精品久久久| 日韩电影免费在线看| 国产欧美精品一区二区色综合朱莉| 91极品视觉盛宴| 国产麻豆一精品一av一免费| 亚洲一区二区三区精品在线| 国产亚洲欧美色| 欧美久久久久久久久中文字幕| 国产美女在线观看一区| 午夜精品福利一区二区三区蜜桃| 久久久精品黄色| 欧美一区二区不卡视频| 一本大道久久a久久综合婷婷| 国产一区二区三区在线观看免费 | 91精品国产综合久久福利| 成人免费毛片app| 毛片av中文字幕一区二区| 亚洲精品成a人| 国产精品久久久一本精品| 精品美女被调教视频大全网站| 91片在线免费观看| 成人一区二区三区在线观看| 蜜桃视频一区二区| 日日夜夜免费精品| 亚洲精品乱码久久久久久黑人| 欧美电影精品一区二区| 欧美日韩中文字幕一区二区| 成年人国产精品| 国产乱码一区二区三区| 久久亚区不卡日本| 精品日韩在线一区| 在线国产电影不卡| 国产91精品一区二区麻豆网站| 一区二区三区四区激情| 欧美色图在线观看| 欧美色区777第一页| 91精品国产91综合久久蜜臀| 久久婷婷综合激情| 国产精品久久久久久久久免费桃花| 亚洲男人的天堂在线观看| 亚洲国产精品一区二区久久恐怖片 | 国产精品国产三级国产aⅴ中文| 亚洲欧洲中文日韩久久av乱码| 香港成人在线视频| 国产精品亚洲成人| 欧洲精品在线观看| 精品粉嫩超白一线天av| 1024精品合集| 另类成人小视频在线| 99国产精品国产精品毛片| 91精品欧美一区二区三区综合在| 国产拍欧美日韩视频二区| 亚洲成av人片一区二区三区| 激情综合网av| 色综合天天视频在线观看| 精品国产乱码久久久久久久| 亚洲日本va在线观看| 欧美高清激情brazzers| 国产精品久久久久久一区二区三区| 亚洲大尺度视频在线观看| 国产盗摄精品一区二区三区在线| 欧美视频在线观看一区二区| 亚洲国产精品精华液2区45| 亚洲3atv精品一区二区三区| 成人性色生活片| 日韩一区二区精品在线观看| 日韩美女视频一区二区| 国产一区二区伦理片| 欧美日韩亚洲另类| 一区在线播放视频| 国产一区二区调教| 在线综合视频播放| 亚洲一本大道在线| 99热国产精品| 国产欧美一区二区三区在线看蜜臀 | 成人av动漫在线| 久久精品夜色噜噜亚洲aⅴ| 天天色天天操综合| 在线观看视频一区二区| 国产精品福利一区| 国产乱人伦偷精品视频不卡 | 亚洲精品在线观看网站| 亚洲国产精品久久久男人的天堂| 波多野结衣在线一区| 久久亚洲精品国产精品紫薇| 免费美女久久99| 欧美一区二区在线观看| 婷婷中文字幕一区三区| 91久久线看在观草草青青| 中文字幕制服丝袜成人av| youjizz久久| 欧美激情一区二区在线| 国产精品99精品久久免费| xnxx国产精品| 国产麻豆精品theporn| 久久噜噜亚洲综合| 国产成人免费高清| 欧美—级在线免费片| 国产精华液一区二区三区| 久久综合精品国产一区二区三区| 美国十次综合导航| 2020国产精品自拍| 国产高清在线观看免费不卡| 国产人伦精品一区二区| 国v精品久久久网| 中文字幕在线不卡视频| av成人动漫在线观看| 自拍偷自拍亚洲精品播放| 国产欧美精品在线观看| 国产91丝袜在线观看| 亚洲国产精品成人综合| 波多野结衣亚洲一区| 亚洲精选在线视频| 欧美日韩精品三区| 六月丁香综合在线视频| 久久毛片高清国产| 99久久久免费精品国产一区二区| 亚洲天堂网中文字| 欧美性色综合网| 欧美96一区二区免费视频| 欧美videofree性高清杂交| 国产一区二区三区不卡在线观看 | 国产人成亚洲第一网站在线播放 | 国产高清亚洲一区| 中文字幕一区二区三中文字幕| 色吊一区二区三区| 亚洲高清在线精品| 日韩精品一区二区在线观看| 国产精品一区二区三区四区| 亚洲欧美自拍偷拍| 91麻豆精品国产91久久久久久久久 | 精品美女在线播放| 91在线观看视频| 日韩av电影免费观看高清完整版| 久久久精品蜜桃|