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

📄 demorb4.html

📁 神经网络学习过程的实例程序
💻 HTML
字号:
<!--This HTML is auto-generated from an m-file.Your changes will be overwritten.--><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:x-large">Radial Basis Overlapping Neurons</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">A radial basis network is trained to respond to specific inputs with targetoutputs.  However, because the spread of the radial basis neurons is too high,each neuron responds essentially the same, and the network cannot be designed.</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">Copyright 1992-2002 The MathWorks, Inc.$Revision: 1.16 $  $Date: 2002/03/29 19:36:04 $</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:medium; page-break-before: auto;"><a name=""></a></p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">Define 21 inputs P and associated targets T.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">P = -1:.1:1;T = [-.9602 -.5770 -.0729  .3771  .6405  .6600  .4609 <span style="color:blue">...</span>      .1336 -.2013 -.4344 -.5000 -.3930 -.1647  .0988 <span style="color:blue">...</span>      .3072  .3960  .3449  .1816 -.0312 -.2189 -.3201];plot(P,T,<span style="color:#B20000">'+'</span>);title(<span style="color:#B20000">'Training Vectors'</span>);xlabel(<span style="color:#B20000">'Input Vector P'</span>);ylabel(<span style="color:#B20000">'Target Vector T'</span>);</pre><img xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" src="demorb4_img02.gif"><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:medium; page-break-before: auto;"><a name=""></a></p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">The function NEWRB quickly creates a radial basis network which approximatesthe function defined by P and T.</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">In addition to the training set and targets, NEWRB takes two arguments, thesum-squared error goal and the spread constant.  The spread of the radialbasis neurons B is set to a very large number.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">eg = 0.02; <span style="color:green">% sum-squared error goal</span>sc = 100;  <span style="color:green">% spread constant</span>net = newrb(P,T,eg,sc);</pre><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:gray; font-style:italic;">NEWRB, neurons = 0, SSE = 3.69973Warning: Rank deficient, rank = 3  tol =   2.1368e-014.Warning: Rank deficient, rank = 4  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Rank deficient, rank = 5  tol =   2.1368e-014.Warning: Matrix is close to singular or badly scaled.         Results may be inaccurate. RCOND = 1.701933e-019.(Type "warning off MATLAB:nearlySingularMatrix" to suppress this warning.)Warning: Rank deficient, rank = 5  tol =   2.2386e-014.</pre><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:medium; page-break-before: auto;"><a name=""></a></p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">NEWRB cannot properly design a radial basis network due to the large overlapof the input regions of the radial basis neurons.  All the neurons alwaysoutput 1, and so cannot be used to generate different responses.  To see howthe network performs with the training set, simulate the network with theoriginal inputs.  Plot the results on the same graph as the training set.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">Y = sim(net,P);hold on;plot(P,Y);hold off;</pre><img xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" src="demorb4_img04.gif"><originalCode xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" code="%% Radial Basis Overlapping Neurons&#xA;% A radial basis network is trained to respond to specific inputs with target&#xA;% outputs.  However, because the spread of the radial basis neurons is too high,&#xA;% each neuron responds essentially the same, and the network cannot be designed.&#xA;% &#xA;% Copyright 1992-2002 The MathWorks, Inc.&#xA;% $Revision: 1.16 $  $Date: 2002/03/29 19:36:04 $&#xA;&#xA;%%&#xA;% Define 21 inputs P and associated targets T.&#xA;&#xA;P = -1:.1:1;&#xA;T = [-.9602 -.5770 -.0729  .3771  .6405  .6600  .4609 ...&#xA;      .1336 -.2013 -.4344 -.5000 -.3930 -.1647  .0988 ...&#xA;      .3072  .3960  .3449  .1816 -.0312 -.2189 -.3201];&#xA;plot(P,T,'+');&#xA;title('Training Vectors');&#xA;xlabel('Input Vector P');&#xA;ylabel('Target Vector T');&#xA;&#xA;%%&#xA;% The function NEWRB quickly creates a radial basis network which approximates&#xA;% the function defined by P and T.&#xA;% &#xA;% In addition to the training set and targets, NEWRB takes two arguments, the &#xA;% sum-squared error goal and the spread constant.  The spread of the radial&#xA;% basis neurons B is set to a very large number.&#xA;&#xA;eg = 0.02; % sum-squared error goal&#xA;sc = 100;  % spread constant&#xA;net = newrb(P,T,eg,sc);&#xA;&#xA;%%&#xA;% NEWRB cannot properly design a radial basis network due to the large overlap&#xA;% of the input regions of the radial basis neurons.  All the neurons always&#xA;% output 1, and so cannot be used to generate different responses.  To see how&#xA;% the network performs with the training set, simulate the network with the&#xA;% original inputs.  Plot the results on the same graph as the training set.&#xA;&#xA;Y = sim(net,P);&#xA;hold on;&#xA;plot(P,Y);&#xA;hold off;&#xA;"></originalCode>

⌨️ 快捷键说明

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