class_docstr: Geometric-Absorbed SPIN Transformation (GA-SPIN) proposed in Ref. [1]
  
  
  Ref: [1] SPIN: Structure-Preserving Inner Offset Network for Scene Text Recognition. AAAI-2021.
class_docstr_tok: ["Geometric-Absorbed","SPIN","Transformation","(","GA-SPIN",")","proposed","in","Ref",".","[","1","]","Ref",":","[","1","]","SPIN",":","Structure-Preserving","Inner","Offset","Network","for","Scene","Text","Recognition",".","AAAI-2021","."]
docstr: Args:
      nz (int): number of paired etas exponents, which means the value of K x 2
docstr_tok: ["Args",":","nz","(","int",")",":","number","of","paired","\betas","exponents",",","which","means","the","value","of","K","x","2"]
code: def init_spin(self, nz):
      """
      Args:
          nz (int): number of paired \betas exponents, which means the value of K x 2
  
      """
      init_id = [0.00] * nz + [5.00]
      if self.offsets:
          init_id += [-5.00]
          # init_id *=3
      init = np.array(init_id)
  
      if self.stn:
          F = self.F
          ctrl_pts_x = np.linspace(-1.0, 1.0, int(F / 2))
          ctrl_pts_y_top = np.linspace(0.0, -1.0, num=int(F / 2))
          ctrl_pts_y_bottom = np.linspace(1.0, 0.0, num=int(F / 2))
          ctrl_pts_top = np.stack([ctrl_pts_x, ctrl_pts_y_top], axis=1)
          ctrl_pts_bottom = np.stack(
              [ctrl_pts_x, ctrl_pts_y_bottom], axis=1
          )
          initial_bias = np.concatenate(
              [ctrl_pts_top, ctrl_pts_bottom], axis=0
          )
          initial_bias = initial_bias.reshape(-1)
          init = np.concatenate([init, initial_bias], axis=0)
      return init
  
file_path: PaddleOCR/ppocr/modeling/transforms/gaspin_transformer.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  from paddle import nn, ParamAttr
  from paddle.nn import functional
  import numpy
  import functools
  from .tps import GridGenerator
label_desc: Use image node_id 2 for calling the GA_SPIN_Transformer obj's underlying member method code with example usage: obj.init_spin(nz) and returns: init