Issue while mapping weights to a New Feedforward Neural network created using newff
1 次查看(过去 30 天)
显示 更早的评论
while testing a weight initialization technique, i am creating an ANN using the newff function as follows :
net = newff(tr_x,tr_t,H,{'logsig','logsig'},tr_algo);
tr_x : input vector ( size = 15 x 563)
tr_t : target vector ( size = 2 x 563)
H : hidden layer nodes ( size = 16 )
{Actv Fucnt for Input to Hidden, Actv Funct for Hidden to Output layers}
"Traingd" the training algorithm.
My Code
net = newff(tr_x,tr_t,H,{'logsig','logsig'},tr_algo);
net = configure(net,tr_x,tr_t);
net.divideParam.trainRatio = 1.0;
net.divideParam.valRatio = 0.0;
net.divideParam.testRatio = 0.0;
net.trainParam.showWindow=0;
net.trainParam.epochs = 3000;
net.trainParam.goal = 0.0001;
net.IW{1,1} = IW; %% Problem statement
now the problem is when i try to map some sample weights (IW) to the net.IW variable, it says that a 14 x 16 matrix should be provided, although the size of input to hidden layer is 14 x 15 as per my inputs.
I dont know from where is it adding one more column to my input vector and asking for 16 instead of 15.
All the details can be seen in the snapshot of my screen which contains the code and the workspace details.
Thank you![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202541/image.bmp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202541/image.bmp)
0 个评论
回答(1 个)
Greg Heath
2019-2-4
You need to add another component equal to unity to account for a bias weight.
Thank you for formally accepting m answer.
Greg
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!