Issue while mapping weights to a New Feedforward Neural network created using newff
조회 수: 3 (최근 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
댓글 수: 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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!