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
Vector of weight and bias values
This example shows how to set and view a network's weight and bias values.
Create and configure a network.
[x,t] = simplefit_dataset; net = feedforwardnet(3); net = configure(net,x,t); view(net)
This network has three weights and three biases in the first layer, and three weights and one bias in the second layer. So, the total number of weight and bias values in the network is 10. Set the weights and biases to random values.
net = setwb(net,rand(10,1));
View the weight and bias values
ans = 0.1576 0.9706 0.9572 ans = 0.5469 0.9575 0.9649