This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Zero weight and bias initialization function


W = initzero(S,PR)
b = initzero(S,[1 1])


W = initzero(S,PR) takes two arguments,


Number of rows (neurons)


R-by-2 matrix of input value ranges = [Pmin Pmax]

and returns an S-by-R weight matrix of zeros.

b = initzero(S,[1 1]) returns an S-by-1 bias vector of zeros.


Here initial weights and biases are calculated for a layer with two inputs ranging over [0 1] and [-2 2] and four neurons.

W = initzero(5,[0 1; -2 2])
b = initzero(5,[1 1])

Network Use

You can create a standard network that uses initzero to initialize its weights by calling newp or newlin.

To prepare the weights and the bias of layer i of a custom network to be initialized with midpoint,

  1. Set net.initFcn to 'initlay'. (net.initParam automatically becomes initlay's default parameters.)

  2. Set net.layers{i}.initFcn to 'initwb'.

  3. Set each net.inputWeights{i,j}.initFcn to 'initzero'.

  4. Set each net.layerWeights{i,j}.initFcn to 'initzero'.

  5. Set each net.biases{i}.initFcn to 'initzero'.

To initialize the network, call init.

See help newp and help newlin for initialization examples.

See Also

| |

Introduced before R2006a

Was this topic helpful?