?? xnewlind.m
字號:
function xNewlind
% This program uses the functions newlind() and sim() to design
% a single linear layer to respond to specific inputs with target outputs.
%
% Author: HUANG Huajiang
% Copyright 2002 UNILAB Research Center,
% East China University of Science and Technology, Shanghai, PRC
% $Revision: 1.0 $ $Date: 2003/03/5 $
%
% [Ref] MATLAB demo, Mathworks Co.
clear all
clc
% (1)定義輸入向量和目標向量
p = [1.0 -1.2]; % P defines two 1-element input patterns (column vectors):
t = [0.5 1.0]; % T defines the associated 1-element targets (column vectors);
% (2)用errsurf()在可能的權值(weight value)和閥值(bias values)
% 范圍內計算網絡誤差,并用plotes()繪制誤差曲面
w_range = -1:0.1:1;
b_range = -1:0.1:1;
es = errsurf(p,t,w_range,b_range,@purelin);
plotes(w_range,b_range,es); % 以等值線繪制誤差曲面(error surface),
% 最佳的權值和閥值使曲面中出現最低點
% (3)用newlind()設計一網絡使誤差最小
net = newlind(p,t);
a = sim(net,p); % 對數p模擬計算網絡
sse = sumsqr(t-a); % 神經元的殘差平方和
plotep(net.IW{1,1},net.b{1},sse); % plotep()用newlind()返回的權值
% 和閥值繪制網絡的“位置”
% (4)檢驗(測試)輸入為-1.2時,是否得到正確的目標值:1
p = -1.2;
a = sim(net,p)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -