ANN_CONV_W — Function to convert the weight and bias stored in a matrix or vector form in the other form (vector or matrix form respectively)
Wtr = ANN_CONV_W(Wini,Nin,Nhid,Nout,Type)
Initial weight and bias values in vector form (Matrix [Px1] where P = {Nb Input+1}*Nb hidden nodes + {Nb hidden nodes+1}*Nb ouput) or in matrix form(2 dimensions Matrix [max(Nhid,Nout) x max(Nin+1,Nhid+1) x 2]):
Wini(1:Nhid,1,1) are the bias for the hidden neurons
Wini(1:Nhid,2:P+1,1) are the weights for the hidden neurons (P weights for each hidden neuron)
Wini(1:M,1,2) are the bias for the ouput neurons
Wini(1:M,2:Nhid+1,2) are the weights for the ouput neurons (Nhid weights for each output neuron)
Number of input nodes
Number of hidden nodes
Number of output nodes
Type of Wini ('matrix' or 'vector')
Resulting conversion (if Wini is of 'matrix' type, Wtr is of 'vector' type and vice and versa)
This function offers a convenient way to store network bias and weight values.
The size of the vector form gives immediately the number of parameters required by a network.