code: def __init__(self, in_channels, num_fiducial, loc_lr, model_name):
      super(LocalizationNetwork, self).__init__()
      self.F = num_fiducial
      F = num_fiducial
      if model_name == "large":
          num_filters_list = [64, 128, 256, 512]
          fc_dim = 256
      else:
          num_filters_list = [16, 32, 64, 128]
          fc_dim = 64
  
      self.block_list = []
      for fno in range(0, len(num_filters_list)):
          num_filters = num_filters_list[fno]
          name = "loc_conv%d" % fno
          conv = self.add_sublayer(
              name,
              ConvBNLayer(
                  in_channels=in_channels,
                  out_channels=num_filters,
                  kernel_size=3,
                  act="relu",
                  name=name,
              ),
          )
          self.block_list.append(conv)
          if fno == len(num_filters_list) - 1:
              pool = nn.AdaptiveAvgPool2D(1)
          else:
              pool = nn.MaxPool2D(kernel_size=2, stride=2, padding=0)
          in_channels = num_filters
          self.block_list.append(pool)
      name = "loc_fc1"
      stdv = 1.0 / math.sqrt(num_filters_list[-1] * 1.0)
      self.fc1 = nn.Linear(
          in_channels,
          fc_dim,
          weight_attr=ParamAttr(
              learning_rate=loc_lr,
              name=name + "_w",
              initializer=nn.initializer.Uniform(-stdv, stdv),
          ),
          bias_attr=ParamAttr(name=name + ".b_0"),
          name=name,
      )
  
      # Init fc2 in LocalizationNetwork
      initial_bias = self.get_initial_fiducials()
      initial_bias = initial_bias.reshape(-1)
      name = "loc_fc2"
      param_attr = ParamAttr(
          learning_rate=loc_lr,
          initializer=nn.initializer.Assign(np.zeros([fc_dim, F * 2])),
          name=name + "_w",
      )
      bias_attr = ParamAttr(
          learning_rate=loc_lr,
          initializer=nn.initializer.Assign(initial_bias),
          name=name + "_b",
      )
      self.fc2 = nn.Linear(
          fc_dim,
          F * 2,
          weight_attr=param_attr,
          bias_attr=bias_attr,
          name=name,
      )
      self.out_channels = F * 2
  
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
label_desc: Use image node_id 1 to create a new LocalizationNetwork object from inherited base classes: nn with example: obj = LocalizationNetwork(in_channels, num_fiducial, loc_lr, model_name)