| Neural Network Toolbox | ![]() |
Form bias and weights into single vector
Syntax
X = formx(net,B,IW,LW)
Description
This function takes weight matrices and bias vectors for a network and reshapes them into a single vector.
X = formx(net,B,IW,LW) takes these arguments,
net - Neural network.
B - Nlx1 cell array of bias vectors.
IW - NlxNi cell array of input weight matrices.
LW - NlxNl cell array of layer weight matrices.
X - Vector of weight and bias values
Examples
Here we create a network with a two-element input, and one layer of three neurons.
net = newff([0 1; -1 1],[3]);
We can get view its weight matrices and bias vectors as follows:
b = net.b iw = net.iw lw = net.lw
We can put these values into a single vector as follows:
x = formx(net,net.b,net.iw,net.lw))
See Also
| errsurf | gensim | ![]() |