docstr: Increase the units number of a fc layer while preserving the functionality
  Proposed in 'Net2Net': https://arxiv.org/abs/1511.05641
  W: [in_dim, out_units]
  bias: [out_units]
docstr_tok: ["Increase","the","units","number","of","a","fc","layer","while","preserving","the","functionality","Proposed","in","'Net2Net","'",":","https",":","\/\/arxiv.org\/abs\/1511.05641","W",":","[","in_dim",",","out_units","]","bias",":","[","out_units","]"]
code: def widen_units(self, new_units_num, noise=None):
      """
      Increase the units number of a fc layer while preserving the functionality
      Proposed in 'Net2Net': https://arxiv.org/abs/1511.05641
      W: [in_dim, out_units]
      bias: [out_units]
      """
      assert new_units_num > self.units, (
          "Invalid new units number: %d" % new_units_num
      )
      assert self._init is not None, "Uninitialized layer"
      old_size, new_size = self.units, new_units_num
      indices, magnifier = get_random_remapping(old_size, new_size)
      # more units
      self._init["W"] = self._init["W"][:, indices]
      self._init["W"][:, old_size:] = apply_noise(
          self._init["W"][:, old_size:], noise.get("wider")
      )
      self.units = new_units_num
      # widen bias variable if exist
      if self.use_bias:
          self._init["bias"] = self._init["bias"][indices]
          self._init["bias"][old_size:] = apply_noise(
              self._init["bias"][old_size:], noise.get("wider")
          )
      if not self.pre_activation:
          # widen batch norm variables if use batch norm
          self.widen_bn(indices, magnifier, noise=noise)
      return indices, magnifier
  
imports: from models.basic_model import BasicModel
  import tensorflow
  import numpy
  import copy
label_desc: Use image node_id 7 for calling the FCLayer obj's underlying member method code with example usage: obj.widen_units(new_units_num, noise) and returns: indices,  magnifier