Setting weight and bias values in custom neural network

6 ビュー (過去 30 日間)
Ken Kueh
Ken Kueh 2012 年 10 月 23 日
コメント済み: Qinzhuo 2022 年 4 月 23 日
Hi all,
How to set value for weights and biases in a custom neural network?
Say: net=network;
net.numInputs=2;
net.inputs{1}.size=2;
net.inputs{2}.size=1;
net.numLayers=2;
net.layers{1}.size=1;
net.layers{2}.size=1;
net.inputConnect(1)=1;
net.inputConnect(1,2)=1;
net.layerConnect(2,1)=1;
net.biasConnect(1)=1;
net.biasConnect(2)=1;
net.biases{1}.learnFcn='learngdm';
net.biases{1}.initFcn='initzero';
net.biases{2}.learnFcn='learngdm';
net.biases{2}.initFcn='initzero';
net.outputConnect(2)=1;
net.layers{1}.transferFcn='tansig';
net.layers{2}.transferFcn = 'purelin';
net.inputweights{1}.initFcn='initzero';
net.inputweights{1}.learnFcn='learngdm';
net.inputweights{2}.initFcn='initzero';
net.inputweights{2}.learnFcn='learngdm';
now i want: bias on layer 1 =0.9; bias on layer 2 =0.7; input 1 weight = 1.1; input 2 weight = 0.9; layer 1 weight = 1.3; layer 2 weight = 1;
how should i configure it?
thanks you

回答 (1 件)

Sachin Ganjare
Sachin Ganjare 2012 年 10 月 23 日
編集済み: Sachin Ganjare 2012 年 10 月 23 日
You can use 'setwb' or 'separatewb' command. Refer link below:
Hope it helps!!!
  2 件のコメント
Ken Kueh
Ken Kueh 2012 年 10 月 24 日
Thank you. But i want to set individual value to weight and bias.
Qinzhuo
Qinzhuo 2022 年 4 月 23 日
net.IW
net.LW
net.b

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by