code: def unitary_init(
      in_features, out_features, kernel_size=None, criterion="he"
  ):
      """Returns a matrix of unitary quaternion numbers.
  
      Arguments
      ---------
      in_features : int
          Number of real values of the input layer (quaternion // 4).
      out_features : int
          Number of real values of the output layer (quaternion // 4).
      kernel_size : int
          Kernel_size for convolutional layers (ex: (3,3)).
      criterion : str
          (glorot, he)
      """
  
      if kernel_size is None:
          kernel_shape = (in_features, out_features)
      else:
          if type(kernel_size) is int:
              kernel_shape = (out_features, in_features) + tuple(
                  (kernel_size,)
              )
          else:
              kernel_shape = (out_features, in_features) + (
                  *kernel_size,
              )
  
      number_of_weights = np.prod(kernel_shape)
      v_r = torch.FloatTensor(number_of_weights).uniform_(-1, 1)
      v_i = torch.FloatTensor(number_of_weights).uniform_(-1, 1)
      v_j = torch.FloatTensor(number_of_weights).uniform_(-1, 1)
      v_k = torch.FloatTensor(number_of_weights).uniform_(-1, 1)
  
      # Unitary quaternion
      for i in range(0, number_of_weights):
          norm = (
              torch.sqrt(
                  v_r[i] ** 2 + v_i[i] ** 2 + v_j[i] ** 2 + v_k[i] ** 2
              )
              + 0.0001
          )
          v_r[i] /= norm
          v_i[i] /= norm
          v_j[i] /= norm
          v_k[i] /= norm
      v_r = v_r.reshape(kernel_shape)
      v_i = v_i.reshape(kernel_shape)
      v_j = v_j.reshape(kernel_shape)
      v_k = v_k.reshape(kernel_shape)
  
      return (v_r, v_i, v_j, v_k)
  
file_path: speechbrain/speechbrain/nnet/quaternion_networks/q_ops.py
imports: import torch
  import math
  import numpy
  import torch.nn.functional
  from scipy.stats import chi
  from torch.autograd import Variable
label_desc: Use image node_id 6 for calling a global function with example usage: unitary_init(in_features, out_features, kernel_size, criterion) and returns: v_r,  v_i,  v_j,  v_k