ニューラルネットワー​クを適応的に学習する​にはどうすればよいで​すか?

ニューラルネットワークを適応的に学習する方法を教えて下さい。

 Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 18 Sep 2015

0 votes

ニューラルネットワークでオンライン学習をしてネットワークを逐次更新するには、ADAPT 関数 (適応学習) を使用します。
 
% ネットワークの入力
P = {[1;2] [2;1] [2;3] [3;1]};
% ネットワークのターゲット(教師パタン)
T = {4 5 7 7};
%%ネットワークの詳細設定
net = linearlayer(0,0);
net = configure(net,P,T);
net.IW{1,1} = [0 0];
net.b{1} = 0;
% バッチ学習
% a: ネットワークの出力
% e: ネットワークのエラー(ターゲット - 出力)
[net,a,e,pf] = adapt(net,P,T)% a: 0 0 0 0
[net,a,e,pf] = adapt(net,P,T)% a: 0 0 0 0
%%学習係数を変更
net.inputWeights{1,1}.learnParam.lr = 0.1;
net.biases{1,1}.learnParam.lr = 0.1;
% オンライン学習
[net,a,e,pf] = adapt(net,P,T)% a: 0 2 6 5.8
[net,a,e,pf] = adapt(net,P,T)% a: 5.520 4.800 7.392 5.976
このコードの前半では入力重みとバイアスの学習係数を設定していないために、バッチ学習となっています。後半で学習係数を設定してオンライン学習になっています。

Plus de réponses (0)

Catégories

En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange

Produits

Version

R2013a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!