matlab-minmax,rands

>> minmax([1 2  3])

ans =

     1     3

>> minmax([1 2;3 4;2 9])

ans =

     1     2
     3     4
     2     9

>> minmax([1 2 6;3 8 4;2 9 5])

ans =

     1     6
     3     8
     2     9

>>

 

第i行分别为参数的第i行的最小值和最大值

 

rands权值和阈值的随机化函数

 

 

help rands
 RANDS Symmetric random weight/bias initialization function.
 
   Syntax
 
     W = rands(S,PR)
     M = rands(S,R)
     v = rands(S);
 
   Description
 
     RANDS is a weight/bias initialization function.
 
     RANDS(S,PR) takes,
       S  - number of neurons.
       PR - Rx2 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.
 
       rands(4,[0 1; -2 2])
       rands(4)
       rands(2,3)
 
   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 will automatically become 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'.
 

你可能感兴趣的:(matlab)