class_docstr: Intialize weights as Orthogonal matrix.
  
  Orthogonal matrix initialization [1]_. For n-dimensional shapes where
  n > 2, the n-1 trailing axes are flattened. For convolutional layers, this
  corresponds to the fan-in, so this makes the initialization usable for
  both dense and convolutional layers.
  
  Parameters
  ----------
  gain : float or 'relu'
      Scaling factor for the weights. Set this to ``1.0`` for linear and
      sigmoid units, to 'relu' or ``sqrt(2)`` for rectified linear units, and
      to ``sqrt(2/(1+alpha**2))`` for leaky rectified linear units with
      leakiness ``alpha``. Other transfer functions may need different
      factors.
  
  References
  ----------
  .. [1] Saxe, Andrew M., James L. McClelland, and Surya Ganguli.
         "Exact solutions to the nonlinear dynamics of learning in deep
         linear neural networks." arXiv preprint arXiv:1312.6120 (2013).
class_docstr_tok: ["Intialize","weights","as","Orthogonal","matrix",".","Orthogonal","matrix","initialization","[","1","]","_",".","For","n-dimensional","shapes","where","n",">","2",",","the","n-1","trailing","axes","are","flattened",".","For","convolutional","layers",",","this","corresponds","to","the","fan-in",",","so","this","makes","the","initialization","usable","for","both","dense","and","convolutional","layers",".","Parameters","--","--","--","--","--","gain",":","float","or","'relu'","Scaling","factor","for","the","weights",".","Set","this","to","``","1.0","``","for","linear","and","sigmoid","units",",","to","'relu","'","or","``","sqrt","(","2",")","``","for","rectified","linear","units",",","and","to","``","sqrt","(","2\/","(","1+alpha","*","*","2",")",")","``","for","leaky","rectified","linear","units","with","leakiness","``","alpha","``",".","Other","transfer","functions","may","need","different","factors",".","References","--","--","--","--","--","..","[","1","]","Saxe",",","Andrew","M.",",","James","L.","McClelland",",","and","Surya","Ganguli",".","``","Exact","solutions","to","the","nonlinear","dynamics","of","learning","in","deep","linear","neural","networks",".","''","arXiv","preprint","arXiv:1312.6120","(","2013",")","."]
code: def sample(self, shape):
      if len(shape) < 2:
          raise RuntimeError(
              "Only shapes of length 2 or more are " "supported."
          )
  
      flat_shape = (shape[0], np.prod(shape[1:]))
      a = get_rng().normal(0.0, 1.0, flat_shape)
      u, _, v = np.linalg.svd(a, full_matrices=False)
      # pick the one with the correct shape
      q = u if u.shape == flat_shape else v
      q = q.reshape(shape)
      return floatX(self.gain * q)
  
imports: import numpy
  from .utils import floatX
  from .random import get_rng
label_desc: Use image node_id 2 for calling the Orthogonal obj's underlying member method code with example usage: obj.sample(shape) and returns: floatX