docstr: Increase the filter number of a conv layer while preserving the functionality
  Proposed in 'Net2Net': https://arxiv.org/abs/1511.05641
docstr_tok: ["Increase","the","filter","number","of","a","conv","layer","while","preserving","the","functionality","Proposed","in","'Net2Net","'",":","https",":","\/\/arxiv.org\/abs\/1511.05641"]
code: def widen_filters(self, new_filter_num, noise=None):
      """
      Increase the filter number of a conv layer while preserving the functionality
      Proposed in 'Net2Net': https://arxiv.org/abs/1511.05641
      """
      assert new_filter_num > self.filter_num, (
          "Invalid new filter number: %d" % new_filter_num
      )
      assert self._init is not None, "Uninitialized layer"
      old_size, new_size = self.filter_num, new_filter_num
      indices, magnifier = get_random_remapping(old_size, new_size)
      # more filters
      self.filter_num = new_filter_num
      new_kernel = self._init["kernel"][:, :, :, indices]
      new_kernel[:, :, :, old_size:] = apply_noise(
          new_kernel[:, :, :, old_size:], noise.get("wider")
      )
      self._init["kernel"] = new_kernel
      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 .basic_model import BasicModel
  import tensorflow
  import numpy
  import copy
label_desc: Use image node_id 7 for calling the ConvLayer obj's underlying member method code with example usage: obj.widen_filters(new_filter_num, noise) and returns: indices,  magnifier