0.0015)dw=learnp(w,P,[],[],[],[],e,[],[],[],[],[])db=learnp(b,ones(1,5),[],[],[],[],e,[],[],[],[],[])%每次學習完后,會返回需要的調整權值" />

亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

matlab-神經網絡-感知機(6)

系統 1552 0

?

%控制感知機的學習過程,學習AND運算
P=[0 1 0 1 1;1 1 1 0 0];
T=[0 1 0 0 0];
net = newp([0 1;0 1],1);
net=init(net);

y=sim(net,P);
e=T-y;
while (mae(e)>0.0015)
?? dw=learnp(w,P,[],[],[],[],e,[],[],[],[],[])
?? db=learnp(b,ones(1,5),[],[],[],[],e,[],[],[],[],[])
?? %每次學習完后,會返回需要的調整權值矩陣和閾值矩陣
?? w=w+dw
?? b=b+db
?? net.iw{1,1}=w
?? net.b{1}=b??
?? y=sim(net,P);
?? e=T-y
end

?

?

learnp用于感知器神經網絡權值和閾值的學習,學習規則是調整網絡的權值和閾值,使網絡平均絕對誤差性能最小,以便實現輸入向量的分類

help learnp
?LEARNP Perceptron weight/bias learning function.
?
?? Syntax
??
???? [dW,LS] = learnp(W,P,Z,N,A,T,E,gW,gA,D,LP,LS)
???? [db,LS] = learnp(b,ones(1,Q),Z,N,A,T,E,gW,gA,D,LP,LS)
???? info = learnp(code)
?
?? Description
?
???? LEARNP is the perceptron weight/bias learning function.
?
???? LEARNP(W,P,Z,N,A,T,E,gW,gA,D,LP,LS) takes several inputs,
?????? W? - SxR weight matrix (or b, an Sx1 bias vector).
?????? P? - RxQ input vectors (or ones(1,Q)).
?????? Z? - SxQ weighted input vectors.
?????? N? - SxQ net input vectors.
?????? A? - SxQ output vectors.
?????? T? - SxQ layer target vectors.
?????? E? - SxQ layer error vectors.
?????? gW - SxR gradient with respect to performance.
?????? gA - SxQ output gradient with respect to performance.
?????? D? - SxS neuron distances.
?????? LP - Learning parameters, none, LP = [].
?????? LS - Learning state, initially should be = [].
???? and returns,
?????? dW - SxR weight (or bias) change matrix.
?????? LS - New learning state.
?
???? LEARNP(CODE) returns useful information for each CODE string:
?????? 'pnames'??? - Returns names of learning parameters.
?????? 'pdefaults' - Returns default learning parameters.
?????? 'needg'???? - Returns 1 if this function uses gW or gA.
?
?? Examples
?
???? Here we define a random input P and error E to a layer
???? with a 2-element input and 3 neurons.
?
?????? p = rand(2,1);
?????? e = rand(3,1);
?
???? Since LEARNP only needs these values to calculate a weight
???? change (see Algorithm below), we will use them to do so.
?
?????? dW = learnp([],p,[],[],[],[],e,[],[],[],[],[])
?
?? Network Use
?
???? You can create a standard network that uses LEARNP with NEWP.
?
???? To prepare the weights and the bias of layer i of a custom network
???? to learn with LEARNP:
???? 1) Set NET.trainFcn to 'trainb'.
??????? (NET.trainParam will automatically become TRAINB's default parameters.)
???? 2) Set NET.adaptFcn to 'trains'.
??????? (NET.adaptParam will automatically become TRAINS's default parameters.)
???? 3) Set each NET.inputWeights{i,j}.learnFcn to 'learnp'.
??????? Set each NET.layerWeights{i,j}.learnFcn to 'learnp'.
??????? Set NET.biases{i}.learnFcn to 'learnp'.
??????? (Each weight and bias learning parameter property will automatically
??????? become the empty matrix since LEARNP has no learning parameters.)
?
???? To train the network (or enable it to adapt):
???? 1) Set NET.trainParam (NET.adaptParam) properties to desired values.
???? 2) Call TRAIN (ADAPT).
?
???? See NEWP for adaption and training examples.
?
?? Algorithm
?
???? LEARNP calculates the weight change dW for a given neuron from the
???? neuron's input P and error E according to the perceptron learning rule:
?
?????? dw =? 0,? if e =? 0
????????? =? p', if e =? 1
????????? = -p', if e = -1
?
???? This can be summarized as:
?
?????? dw = e*p'

?

?

?

?

?

?

?

?

?

?

>> plotpv(P,T)
>> plotpc(net.iw{1,1},net.b{1})


matlab-神經網絡-感知機(6)
?

?

matlab-神經網絡-感知機(6)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 天天操夜夜操狠狠操 | 国内精品伊人久久大香线焦 | 四虎地址8848| 成人久久在线 | 亚洲天天做日日摸天天做 | 国产高清国产专区国产精品 | 日本 欧美 国产 | 全免费a级毛片免费看不卡 全免费a级毛片免费看视频免 | se94se亚洲欧美在线 | 这里只有精品在线观看 | 日本一区二区三区高清福利视频 | 久久er99热精品一区二区 | 欧美亚洲国产成人综合在线 | 亚洲欧美综合国产精品一区 | 欧美乱妇高清视频免欢看关 | 日韩中文在线观看 | 欧美日韩在线看 | 国产免费不卡v片在线观看 国产免费不卡视频 | 俺去也最新网站 | 福利社91| 免费一区二区 | 青青免费视频精品一区二区 | 国产一区二区三区久久精品 | 免费国产a | 美女在线看永久免费网址 | 国产亚洲精品美女2020久久 | 九九九九热精品免费视频 | 亚洲综合色自拍一区 | 国产精品在线观看 | 成人性色生活影片 | 日本中文字幕在线观看 | 欧美一级录像 | 久久精品视频免费播放 | 亚洲欧美在线看 | 九九爱这里只有精品 | 国产精品一级毛片不收费 | 天天躁夜夜躁狂狂躁综合 | 深夜在线网址 | 天天射天天爱天天干 | 91av国产在线 | 国产成人午夜性a一级毛片 国产成人午夜性视频影院 国产成人系列 |