Name

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)

Calling Sequence

Wtr = ANN_CONV_W(Wini,Nin,Nhid,Nout,Type)

Parameters

Wini

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)

Nin

Number of input nodes

Nhid

Number of hidden nodes

Nout

Number of output nodes

Type

Type of Wini ('matrix' or 'vector')

Wtr

Resulting conversion (if Wini is of 'matrix' type, Wtr is of 'vector' type and vice and versa)

Description

  • 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.

Examples

   // Ouput from a network with 6 input nodes, 4 nodes in the hidden layer and 1 output node
   IN = rand(6,100);
   W  = rand(4,7,2);
   [OUT,IN_W,HID_OUT] = ANN_SIM(IN,4,1,W);
   Wvect  = ANN_CONV_W(W,6,4,1,'matrix');

  

See Also

ANN_LMBR , ANN_JACOB , ANN_NORM , ANN_SIM

Authors

Julien Lerat

CEMAGREF Antony, HBAN Unit, julien.lerat@cemagref.fr