Set all network weight and bias values with single vector
net = setwb(net,wb)
This function sets a network's weight and biases to a vector of values.
net = setwb(net,wb) takes the following inputs:
Vector of weight and bias values
Here you create a network with a two-element input and one layer of three neurons.
net = feedforwardnet(3); net = configure(net,[0;0],0);
The network has six weights (3 neurons * 2 input elements) and three biases (3 neurons) for a total of nine weight and bias values. You can set them to random values as follows:
net = setwb(net,rand(9,1));
You can then view the weight and bias values as follows: