class_docstr: Initialization strategies.
      
docstr: Initialization method for QuatE
          
docstr_tok: ["Initialization","method","for","QuatE"]
code: def quaternion_initialization(self):
      """Initialization method for QuatE"""
      sub_embed_dim = self.embed_dim // 4
      init_value = 1.0 / np.sqrt(2 * self.num_embed)
      rng = RandomState(123)
  
      weight_shape = (self.num_embed, sub_embed_dim)
      num_weights = np.prod(weight_shape)
      v_i = uniform(0.0, 1.0, num_weights)
      v_j = uniform(0.0, 1.0, num_weights)
      v_k = uniform(0.0, 1.0, num_weights)
  
      for i in range(num_weights):
          norm = np.sqrt(v_i[i] ** 2 + v_j[i] ** 2 + v_k[i] ** 2) + 1e-4
          v_i[i] /= norm
          v_j[i] /= norm
          v_k[i] /= norm
      v_i = v_i.reshape(weight_shape)
      v_j = v_j.reshape(weight_shape)
      v_k = v_k.reshape(weight_shape)
  
      modulus = uniform(
          -init_value, init_value, size=weight_shape, seed=123
      )
      phase = uniform(-np.pi, np.pi, size=weight_shape, seed=123)
  
      w_r = modulus * np.cos(phase)
      w_i = modulus * v_i * np.sin(phase)
      w_j = modulus * v_j * np.sin(phase)
      w_k = modulus * v_k * np.sin(phase)
  
      weight = np.concatenate([w_r, w_i, w_j, w_k], axis=-1).astype(
          np.float32
      )
      return weight
  
file_path: PGL/apps/Graph4KG/models/init_func.py
imports: import numpy
  from numpy.random import RandomState
  from utils import uniform, gram_schimidt_process
label_desc: Use image node_id 4 for calling the InitFunction obj's underlying member method code with example usage: obj.quaternion_initialization() and returns: weight