1
votes

I've seen the following instructions in one of my AI courses:

net = newp([-2 2;-2 2],2])
net.IW {1,1} = [-1 1; 3 4]
net.b{1} = [-2,3]

How does the neural network look? The perceptron has 2 neurons?

1

1 Answers

2
votes

the easiest way to take a look at it is via:

view(net) 

there you can see the number of inputs outputs and layers. Also you can check with

help netp

the documentation of the command and in there it says

 NET = newp(P,T,TF,LF) takes these inputs,
       P  - RxQ matrix of Q1 representative input vectors.
       T  - SxQ matrix of Q2 representative target vectors.
       TF - Transfer function, default = 'hardlim'.
       LF - Learning function, default = 'learnp'.

net.iw{1,1} sets the input weigths to the chosen numbers amd net.b{1} sets the biases of the network to the vector [-2,3].

Did this clearify things for you?