Neural Network Toolbox™ Previous page   Next Page 
rands
 Provide feedback about this page

Symmetric random weight/bias initialization function

Syntax

Description

rands is a weight/bias initialization function.

rands(S,PR) takes

S
Number of neurons
PR
R x 2 matrix of R input ranges

and returns an S-by-R weight matrix of random values between -1 and 1.

rands(S,R) returns an S-by-R matrix of random values. rands(S) returns an S-by-1 vector of random values.

Examples

Here three sets of random values are generated with rands.

Network Use

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

  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 'rands'. Set each net.layerWeights{i,j}.initFcn to 'rands'. Set each net.biases{i}.initFcn to 'rands'.

To initialize the network, call init.

See Also

randnr, randnc, initwb, initlay, init


 Provide feedback about this page 

Previous page randnr randtop Next page

 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS