Architecture of the neural network by nftool?
显示 更早的评论
I trained a neural network of 1-2-1 configuration with a cos wave from 0:0.1:2*pi, assigning the nftool option for number of hidden neurons a value of 2. I saved the network into workspace as net1:
After that I changed the weights as:
net1.IW{1,1}=[1 5]';
net1.b{1,1}=[2 2]';
net1.LW{2,1}=[4 8];
net1.b{2,1}=7;
I didn't make any other changes to the network.
Then I executed the following code to check whether I had rightly understood the architecture of the NN:
sum(tansig(0.*net1.IW{1,1}'+net1.b{1,1}').*net1.LW{2,1})+net1.b{2,1}
sim(net1,0);
However, the two lines gave me different results.
ans =
18.5683
ans =
2.0855
Shouldn't the results of the last two lines be the same? Is something wrong with the toolbox or have I misunderstood the architecture of the generated network?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!