docstr: @param in_channels: input shape
  @param hidden_size: hidden_size for RNN and Embedding
  @param out_channels: num_classes to rec
  @param max_text_length: max text pred
docstr_tok: ["@","param","in_channels",":","input","shape","@","param","hidden_size",":","hidden_size","for","RNN","and","Embedding","@","param","out_channels",":","num_classes","to","rec","@","param","max_text_length",":","max","text","pred"]
code: def __init__(
      self,
      in_channels,
      hidden_size,
      out_channels=30,
      max_text_length=500,
      loc_reg_num=4,
      fc_decay=0.0,
      **kwargs,
  ):
      """
      @param in_channels: input shape
      @param hidden_size: hidden_size for RNN and Embedding
      @param out_channels: num_classes to rec
      @param max_text_length: max text pred
      """
      super().__init__()
      in_channels = in_channels[-1]
      self.hidden_size = hidden_size
      self.max_text_length = max_text_length
      self.emb = self._char_to_onehot
      self.num_embeddings = out_channels
      self.loc_reg_num = loc_reg_num
  
      # structure
      self.structure_attention_cell = AttentionGRUCell(
          in_channels, hidden_size, self.num_embeddings
      )
      weight_attr, bias_attr = get_para_bias_attr(
          l2_decay=fc_decay, k=hidden_size
      )
      weight_attr1_1, bias_attr1_1 = get_para_bias_attr(
          l2_decay=fc_decay, k=hidden_size
      )
      weight_attr1_2, bias_attr1_2 = get_para_bias_attr(
          l2_decay=fc_decay, k=hidden_size
      )
      self.structure_generator = nn.Sequential(
          nn.Linear(
              self.hidden_size,
              self.hidden_size,
              weight_attr=weight_attr1_2,
              bias_attr=bias_attr1_2,
          ),
          nn.Linear(
              hidden_size,
              out_channels,
              weight_attr=weight_attr,
              bias_attr=bias_attr,
          ),
      )
      # loc
      weight_attr1, bias_attr1 = get_para_bias_attr(
          l2_decay=fc_decay, k=self.hidden_size
      )
      weight_attr2, bias_attr2 = get_para_bias_attr(
          l2_decay=fc_decay, k=self.hidden_size
      )
      self.loc_generator = nn.Sequential(
          nn.Linear(
              self.hidden_size,
              self.hidden_size,
              weight_attr=weight_attr1,
              bias_attr=bias_attr1,
          ),
          nn.Linear(
              self.hidden_size,
              loc_reg_num,
              weight_attr=weight_attr2,
              bias_attr=bias_attr2,
          ),
          nn.Sigmoid(),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  import paddle.nn
  from paddle import ParamAttr
  import paddle.nn.functional
  import numpy
  from .rec_att_head import AttentionGRUCell
label_desc: Use image node_id 1 to create a new SLAHead object from inherited base classes: nn with example: obj = SLAHead(in_channels, hidden_size, out_channels, max_text_length, loc_reg_num, fc_decay)