arguments of "newp" command of neural network
24 views (last 30 days)
Show older comments
Mudasir Ahmed
on 7 Jun 2015
Commented: Walter Roberson
on 7 Jun 2015
hi
i hope all are fit and fine. i want to ask a question related the command of neural network "newp". i want to train the weights and bias of 3 input AND gate. but i feel little bit difficulty in initialization of newp command. means how we select first argument of newp and also suggest me how to write it according to the problem. kindly help me in this regard.
Regards, Mudasir
clear
clc
net.IW{1,1}=[0 0 0]
net.b{1}=0
p=[0 1 0 1 0 1 0 1;0 0 1 1 0 0 1 1;0 0 0 0 1 1 1 1]
net=newp([1 8;1 3],1)
t=[0 0 0 0 0 0 0 1]
net.trainParam.epochs=5
net=train(net,p,t)
net.IW{1,1}
net.b{1}
a=sim(net,p)
error=[a(1)-t(1) a(2)-t(2) a(3)-t(3) a(4)-t(4) a(5)-t(5) a(6)-t(6) a(7)-t(7) a(8)-t(8)]
0 Comments
Accepted Answer
Walter Roberson
on 7 Jun 2015
newp() was replaced as of r2010b which is why you cannot find it documented. Use the replacement. http://www.mathworks.com/help/releases/R2012a/toolbox/nnet/ref/perceptron.html
2 Comments
Walter Roberson
on 7 Jun 2015
It says at the top it was obsoleted. There is no point in trying to figure out how it works.
More Answers (0)
See Also
Categories
Find more on Define Shallow Neural Network Architectures in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!