class_docstr: Grid Generator of RARE, which produces P_prime by multiplying T with P 
class_docstr_tok: ["Grid","Generator","of","RARE",",","which","produces","P_prime","by","multiplying","T","with","P"]
docstr: Return inv_delta_C which is needed to calculate T 
docstr_tok: ["Return","inv_delta_C","which","is","needed","to","calculate","T"]
code: def _build_inv_delta_C(self, F, C):
      """Return inv_delta_C which is needed to calculate T"""
      hat_C = np.zeros((F, F), dtype=float)  # F x F
      for i in range(0, F):
          for j in range(i, F):
              r = np.linalg.norm(C[i] - C[j])
              hat_C[i, j] = r
              hat_C[j, i] = r
      np.fill_diagonal(hat_C, 1)
      hat_C = (hat_C**2) * np.log(hat_C)
      # print(C.shape, hat_C.shape)
      delta_C = np.concatenate(  # F+3 x F+3
          [
              np.concatenate(
                  [np.ones((F, 1)), C, hat_C], axis=1
              ),  # F x F+3
              np.concatenate(
                  [np.zeros((2, 3)), np.transpose(C)], axis=1
              ),  # 2 x F+3
              np.concatenate(
                  [np.zeros((1, 3)), np.ones((1, F))], axis=1
              ),  # 1 x F+3
          ],
          axis=0,
      )
      inv_delta_C = np.linalg.inv(delta_C)
      return inv_delta_C
  
file_path: EasyOCR/trainer/modules/transformation.py
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 3 for calling the GridGenerator obj's underlying member method code with example usage: obj._build_inv_delta_C(F, C) and returns: inv_delta_C