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

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

?? nnmodel.m

?? 人工神經(jīng)網(wǎng)絡(luò):MATLAB源程序用于訓(xùn)練測(cè)試
?? M
?? 第 1 頁 / 共 3 頁
字號(hào):
%#											
%# 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91看片淫黄大片一级在线观看| 欧美日本一区二区三区四区| 亚洲成年人网站在线观看| 欧美电影免费观看高清完整版在| 99久久婷婷国产| 精品一区二区三区免费播放| 亚洲电影在线免费观看| 国产欧美精品一区二区三区四区 | 日韩免费观看2025年上映的电影| 99re在线精品| 国产电影一区二区三区| 日韩va欧美va亚洲va久久| 成人免费视频在线观看| 亚洲精品在线电影| 欧美精品v国产精品v日韩精品 | 91精品国产91热久久久做人人| 成人福利视频网站| 国产成人免费高清| 久久99国产精品久久99果冻传媒| 亚洲福利国产精品| 亚洲激情网站免费观看| 国产精品电影一区二区| 久久久久久久久久久久电影| 美女视频黄久久| 一区二区久久久| 日韩免费看的电影| 日韩一级欧美一级| 99久久99久久精品免费观看| 久久亚洲综合av| 国产美女精品在线| 国产精品毛片久久久久久久| 日韩精品专区在线影院观看| 91精品国产手机| 欧美日韩三级视频| 色94色欧美sute亚洲线路一久| 成人做爰69片免费看网站| 国产高清亚洲一区| 国产精品91xxx| 国产精品小仙女| 国产乱子伦视频一区二区三区 | 97精品电影院| 国产乱国产乱300精品| 一区二区三区不卡在线观看| 色婷婷国产精品久久包臀| 东方欧美亚洲色图在线| 国产精品乡下勾搭老头1| 国产一区激情在线| 国产精品18久久久久久久网站| 国产麻豆91精品| 国产老妇另类xxxxx| 国产成人综合视频| a亚洲天堂av| 色欧美片视频在线观看| 欧美精品日日鲁夜夜添| 日韩一区二区三区高清免费看看| 欧美一区二区三区影视| 日韩精品一区二区在线| 久久九九久久九九| 中文字幕一区二区三| 亚洲一区二区综合| 丝袜美腿一区二区三区| 精品一区二区三区免费观看 | 国产精品亚洲综合一区在线观看| 国产剧情在线观看一区二区| 成人高清免费观看| 久久精品99国产精品日本| 综合激情成人伊人| 国产亚洲美州欧州综合国| 国产精品久久网站| 一区二区三区四区国产精品| 天天亚洲美女在线视频| 久久成人免费网站| 成人免费看片app下载| 日本韩国精品在线| 日韩欧美亚洲国产精品字幕久久久 | 精品免费日韩av| 亚洲三级电影全部在线观看高清| 午夜不卡av在线| 国产自产高清不卡| 91蝌蚪国产九色| 欧美一区二区精品在线| 国产精品久久久久影院| 性久久久久久久久久久久| 极品少妇一区二区三区精品视频| 成人在线视频一区| 欧美蜜桃一区二区三区| 久久久国产一区二区三区四区小说 | 精品一区二区三区久久| 国产一区二区三区观看| 日韩一区二区在线免费观看| 国产精品免费人成网站| 日韩精品每日更新| 成人污污视频在线观看| 成人毛片视频在线观看| 国产99久久精品| 亚洲123区在线观看| 国产精品白丝jk白祙喷水网站| 99精品国产91久久久久久| 91精品国产色综合久久不卡蜜臀 | 国产九色sp调教91| 欧美性猛交xxxxxx富婆| 国产午夜精品一区二区三区四区| 亚洲成人av一区二区| 成人一级片网址| 精品对白一区国产伦| 午夜精品一区二区三区三上悠亚| 成人国产在线观看| 精品久久久久香蕉网| 国产成人精品亚洲777人妖 | 国产精品对白交换视频 | 精品视频999| 国产欧美日韩激情| 麻豆国产欧美日韩综合精品二区 | 偷窥少妇高潮呻吟av久久免费| 国产99精品在线观看| 欧美videossexotv100| 亚洲成人免费av| 色94色欧美sute亚洲线路一ni| 久久综合丝袜日本网| 美国欧美日韩国产在线播放| 欧美日韩国产美女| 亚洲激情五月婷婷| 成人av免费在线观看| 国产欧美日韩视频一区二区| 精品一区二区免费| 欧美一级欧美一级在线播放| 亚洲123区在线观看| 欧美色手机在线观看| 亚洲精品国产一区二区精华液| 波多野结衣亚洲| 中文字幕免费不卡在线| 高清在线不卡av| 国产女人18水真多18精品一级做| 国产精品一区二区在线观看网站| 久久蜜臀中文字幕| 国产一区二区0| 精品久久国产字幕高潮| 韩国v欧美v亚洲v日本v| www激情久久| 国产精品自拍在线| 国产三级欧美三级| 国产不卡视频一区二区三区| 中文字幕国产精品一区二区| 成人黄色免费短视频| 中文字幕乱码日本亚洲一区二区| 国产91清纯白嫩初高中在线观看| 国产午夜精品久久久久久免费视 | 亚洲综合色视频| 欧美美女网站色| 久久国产麻豆精品| 久久综合九色综合欧美98| 成人午夜伦理影院| 亚洲三级理论片| 在线电影一区二区三区| 韩国理伦片一区二区三区在线播放| 久久午夜羞羞影院免费观看| 成人免费看片app下载| 国产精品久久二区二区| 在线一区二区三区| 午夜免费久久看| 久久在线观看免费| 成人av在线资源网| 亚洲男人电影天堂| 日韩一区二区麻豆国产| 国产乱淫av一区二区三区| 中文字幕一区二区日韩精品绯色| 欧美自拍丝袜亚洲| 另类专区欧美蜜桃臀第一页| 91色视频在线| 欧美一区二区精品久久911| 日韩欧美国产麻豆| 亚洲柠檬福利资源导航| 激情av综合网| ㊣最新国产の精品bt伙计久久| 精品一区二区影视| 国产亚洲成aⅴ人片在线观看| 91蜜桃在线免费视频| 日韩精品久久久久久| 26uuu精品一区二区| 91国偷自产一区二区开放时间 | 成人激情免费网站| 亚洲激情校园春色| 欧美r级在线观看| 在线精品视频免费播放| 裸体歌舞表演一区二区| 亚洲男人天堂一区| 精品国产露脸精彩对白| 91视频一区二区| 国产最新精品免费| 成人一区二区三区| 免费在线成人网| 国产精品护士白丝一区av| 91精品国产乱码久久蜜臀| 99精品视频在线播放观看| 日韩**一区毛片| 欧美xxxx老人做受| 男男视频亚洲欧美| 色婷婷久久久久swag精品| 日韩美女视频一区二区在线观看| 97精品久久久久中文字幕|