code: def complex_init(
      in_features, out_features, kernel_size=None, criterion="glorot"
  ):
      """Returns a matrice of complex numbers initialized as described in:
      "Deep Complex Networks", Trabelsi C. et al.
  
      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) (default "glorot")
      """
  
      if kernel_size is not None:
          receptive_field = np.prod(kernel_size)
          fan_out = out_features * receptive_field
          fan_in = in_features * receptive_field
      else:
          fan_out = out_features
          fan_in = in_features
      if criterion == "glorot":
          s = 1.0 / (fan_in + fan_out)
      else:
          s = 1.0 / fan_in
  
      if kernel_size is None:
          size = (in_features, out_features)
      else:
          if type(kernel_size) is int:
              size = (out_features, in_features) + tuple((kernel_size,))
          else:
              size = (out_features, in_features) + (*kernel_size,)
  
      modulus = np.random.rayleigh(scale=s, size=size)
      phase = np.random.uniform(-np.pi, np.pi, size)
      weight_real = modulus * np.cos(phase)
      weight_imag = modulus * np.sin(phase)
  
      return (weight_real, weight_imag)
  
file_path: speechbrain/speechbrain/nnet/complex_networks/c_ops.py
imports: import torch
  import torch.nn.functional
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: complex_init(in_features, out_features, kernel_size, criterion) and returns: weight_real,  weight_imag