How to edit weights and bias of narxnet?

5 ビュー (過去 30 日間)
Sarwmitra Sharma
Sarwmitra Sharma 2020 年 7 月 1 日
回答済み: Shubham Rawat 2020 年 8 月 14 日
I want to change weights and bias of narx neural network manually. I have this code. but no change is observed.
Y1 = net(Xs,Xi,Ai);
wb=getwb(net);
net=setwb(net,wb*0);
wb=getwb(net);
Y2 = net(Xs,Xi,Ai);
Y1 and Y2 give same result. it seems that changing weights and bias dont change results. If this is not the correct way then how to change weights and bias such that it changes the output of neural network?
  1 件のコメント
Sarwmitra Sharma
Sarwmitra Sharma 2020 年 7 月 1 日
the above code works for forwardfeed network but not for narxnet?

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

回答 (1 件)

Shubham Rawat
Shubham Rawat 2020 年 8 月 14 日
Hi Sarwmitra,
To change the weights and biases in NARX net:
You can train the NARX network for a loop first, and then set the weight and bias. the codes are as follows:
Y1 = net(Xs, Xi, Ai);
net.IW{1} = %value% %the input-to-hidden layer weights
net.LW{2} = %value% %the input-to-output layer weights
net.b{1} = %value% %the input-to-hidden layer bias
net.b{2} = %value% %the input-to-output layer bias
Y2 = net(Xs,Xi,Ai);

Community Treasure Hunt

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

Start Hunting!

Translated by