def xavier_weight(nin, nout=None):
 if (nout == None):
  nout = nin
 r = (numpy.sqrt(6.0) / numpy.sqrt((nin + nout)))
 W = (((numpy.random.rand(nin, nout) * 2) * r) - r)
 return W.astype('float32')

def xavier_weight ( nin , nout = None ) : if ( nout == None ) : nout = nin r = ( numpy . sqrt ( 6.0 ) / numpy . sqrt ( ( nin + nout ) ) ) W = ( ( ( numpy . random . rand ( nin , nout ) * 2 ) * r ) - r ) return W . astype ( 'float32' )
xavier init .