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

📄 demohop4.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">Spurious Stable Points</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">A Hopfield network with five neurons is designed to have four stableequilibria.  However, unavoidably, it has other undesired equilibria.</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">Copyright 1992-2002 The MathWorks, Inc.$Revision: 1.18 $  $Date: 2002/03/29 19:36:20 $</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">We would like to obtain a Hopfield network that has the four stable pointsdefined by the two target (column) vectors in T.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">T = [+1 +1 -1 +1; <span style="color:blue">...</span>      -1 +1 +1 -1; <span style="color:blue">...</span><span style="color:green"> </span>      -1 -1 -1 +1; <span style="color:blue">...</span>      +1 +1 +1 +1; <span style="color:blue">...</span>      -1 -1 +1 +1];</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">The function NEWHOP creates Hopfield networks given the stable points T.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">net = newhop(T);</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">Here we define 4 random starting points and simulate the Hopfield network for50 steps.</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">Some initial conditions will lead to desired stable points.  Others will leadto undesired stable points.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">P = {rands(5,4)};[Y,Pf,Af] = sim(net,{4 50},{},P);Y{end}</pre><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:gray; font-style:italic;">ans =    -1     1     1     1    -1     1    -1     1    -1    -1    -1     1     1     1     1     1     1    -1    -1     1</pre><originalCode xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" code="%% Spurious Stable Points&#xA;% A Hopfield network with five neurons is designed to have four stable&#xA;% equilibria.  However, unavoidably, it has other undesired equilibria.&#xA;% &#xA;% Copyright 1992-2002 The MathWorks, Inc.&#xA;% $Revision: 1.18 $  $Date: 2002/03/29 19:36:20 $&#xA;&#xA;%%&#xA;% We would like to obtain a Hopfield network that has the four stable points&#xA;% defined by the two target (column) vectors in T.&#xA;&#xA;T = [+1 +1 -1 +1; ...&#xA;      -1 +1 +1 -1; ... &#xA;      -1 -1 -1 +1; ...&#xA;      +1 +1 +1 +1; ...&#xA;      -1 -1 +1 +1];&#xA;&#xA;%%&#xA;% The function NEWHOP creates Hopfield networks given the stable points T.&#xA;&#xA;net = newhop(T);&#xA;&#xA;%%&#xA;% Here we define 4 random starting points and simulate the Hopfield network for&#xA;% 50 steps.&#xA;%&#xA;% Some initial conditions will lead to desired stable points.  Others will lead&#xA;% to undesired stable points.&#xA;&#xA;P = {rands(5,4)};&#xA;[Y,Pf,Af] = sim(net,{4 50},{},P);&#xA;Y{end}&#xA;"></originalCode>

⌨️ 快捷键说明

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