class_docstr: Decoder/generator architecture.
class_docstr_tok: ["Decoder\/generator","architecture","."]
docstr: Instantiate layer.
  
  Args:
    name: name of the layer.
    num_up: how many upsampling layers.
    num_filters_base: base number of filters.
    num_residual_blocks: number of residual blocks.
docstr_tok: ["Instantiate","layer",".","Args",":","name",":","name","of","the","layer",".","num_up",":","how","many","upsampling","layers",".","num_filters_base",":","base","number","of","filters",".","num_residual_blocks",":","number","of","residual","blocks","."]
code: def __init__(
      self,
      name="Decoder",
      num_up=4,
      num_filters_base=60,
      num_residual_blocks=9,
  ):
      """Instantiate layer.
  
      Args:
        name: name of the layer.
        num_up: how many upsampling layers.
        num_filters_base: base number of filters.
        num_residual_blocks: number of residual blocks.
      """
      head = [
          ChannelNorm(),
          tf.keras.layers.Conv2D(
              filters=num_filters_base * (2**num_up),
              kernel_size=3,
              padding="same",
          ),
          ChannelNorm(),
      ]
  
      residual_blocks = []
      for block_idx in range(num_residual_blocks):
          residual_blocks.append(
              ResidualBlock(
                  filters=num_filters_base * (2**num_up),
                  kernel_size=3,
                  name="block_{}".format(block_idx),
                  activation="relu",
                  padding="same",
              )
          )
  
      tail = []
      for scale in reversed(range(num_up)):
          filters = num_filters_base * (2**scale)
          tail += [
              tf.keras.layers.Conv2DTranspose(
                  filters=filters,
                  kernel_size=3,
                  padding="same",
                  strides=2,
              ),
              ChannelNorm(),
              tf.keras.layers.ReLU(),
          ]
  
      # Final conv layer.
      tail.append(
          tf.keras.layers.Conv2D(
              filters=3, kernel_size=7, padding="same"
          )
      )
  
      self._head = tf.keras.Sequential(head)
      self._residual_blocks = tf.keras.Sequential(residual_blocks)
      self._tail = tf.keras.Sequential(tail)
  
      super(Decoder, self).__init__(name=name)
  
imports: import collections
  from compare_gan.architectures import abstract_arch
  from compare_gan.architectures import arch_ops
  import numpy
  import tensorflow.compat.v1
  import tensorflow_compression
  from hific.helpers import ModelMode
label_desc: Use image node_id 1 to create a new Decoder object from inherited base classes: tf.keras.layers with example: obj = Decoder(name, num_up, num_filters_base, num_residual_blocks)