class_docstr: Implementation of the Residual Dense Network for image super-scaling.
  
  The network is the one described in https://arxiv.org/abs/1802.08797 (Zhang et al. 2018).
  
  Args:
      arch_params: dictionary, contains the network parameters C, D, G, G0, x.
      patch_size: integer or None, determines the input size. Only needed at
          training time, for prediction is set to None.
      c_dim: integer, number of channels of the input image.
      kernel_size: integer, common kernel size for convolutions.
      upscaling: string, 'ups' or 'shuffle', determines which implementation
          of the upscaling layer to use.
      init_extreme_val: extreme values for the RandomUniform initializer.
      weights: string, if not empty, download and load pre-trained weights.
          Overrides other parameters.
  
  Attributes:
      C: integer, number of conv layer inside each residual dense blocks (RDB).
      D: integer, number of RDBs.
      G: integer, number of convolution output filters inside the RDBs.
      G0: integer, number of output filters of each RDB.
      x: integer, the scaling factor.
      model: Keras model of the RDN.
      name: name used to identify what upscaling network is used during training.
      model._name: identifies this network as the generator network
          in the compound model built by the trainer class.
class_docstr_tok: ["Implementation","of","the","Residual","Dense","Network","for","image","super-scaling",".","The","network","is","the","one","described","in","https",":","\/\/arxiv.org\/abs\/1802.08797","(","Zhang","et","al",".","2018",")",".","Args",":","arch_params",":","dictionary",",","contains","the","network","parameters","C",",","D",",","G",",","G0",",","x.","patch_size",":","integer","or","None",",","determines","the","input","size",".","Only","needed","at","training","time",",","for","prediction","is","set","to","None",".","c_dim",":","integer",",","number","of","channels","of","the","input","image",".","kernel_size",":","integer",",","common","kernel","size","for","convolutions",".","upscaling",":","string",",","'ups","'","or","'shuffle","'",",","determines","which","implementation","of","the","upscaling","layer","to","use",".","init_extreme_val",":","extreme","values","for","the","RandomUniform","initializer",".","weights",":","string",",","if","not","empty",",","download","and","load","pre-trained","weights",".","Overrides","other","parameters",".","Attributes",":","C",":","integer",",","number","of","conv","layer","inside","each","residual","dense","blocks","(","RDB",")",".","D",":","integer",",","number","of","RDBs",".","G",":","integer",",","number","of","convolution","output","filters","inside","the","RDBs",".","G0",":","integer",",","number","of","output","filters","of","each","RDB",".","x",":","integer",",","the","scaling","factor",".","model",":","Keras","model","of","the","RDN",".","name",":","name","used","to","identify","what","upscaling","network","is","used","during","training",".","model._name",":","identifies","this","network","as","the","generator","network","in","the","compound","model","built","by","the","trainer","class","."]
docstr: RDBs blocks.
  
  Args:
      input_layer: input layer to the RDB blocks (e.g. the second convolutional layer F_0).
  
  Returns:
      concatenation of RDBs output feature maps with G0 feature maps.
docstr_tok: ["RDBs","blocks",".","Args",":","input_layer",":","input","layer","to","the","RDB","blocks","(","e.g",".","the","second","convolutional","layer","F_0",")",".","Returns",":","concatenation","of","RDBs","output","feature","maps","with","G0","feature","maps","."]
code: def _RDBs(self, input_layer):
      """RDBs blocks.
  
      Args:
          input_layer: input layer to the RDB blocks (e.g. the second convolutional layer F_0).
  
      Returns:
          concatenation of RDBs output feature maps with G0 feature maps.
      """
      rdb_concat = list()
      rdb_in = input_layer
      for d in range(1, self.D + 1):
          x = rdb_in
          for c in range(1, self.C + 1):
              F_dc = Conv2D(
                  self.G,
                  kernel_size=self.kernel_size,
                  padding="same",
                  kernel_initializer=self.initializer,
                  name="F_%d_%d" % (d, c),
              )(x)
              F_dc = Activation("relu", name="F_%d_%d_Relu" % (d, c))(
                  F_dc
              )
              # concatenate input and output of ConvRelu block
              # x = [input_layer,F_11(input_layer),F_12([input_layer,F_11(input_layer)]), F_13..]
              x = concatenate(
                  [x, F_dc], axis=3, name="RDB_Concat_%d_%d" % (d, c)
              )
          # 1x1 convolution (Local Feature Fusion)
          x = Conv2D(
              self.G0,
              kernel_size=1,
              kernel_initializer=self.initializer,
              name="LFF_%d" % (d),
          )(x)
          # Local Residual Learning F_{i,LF} + F_{i-1}
          rdb_in = Add(name="LRL_%d" % (d))([x, rdb_in])
          rdb_concat.append(rdb_in)
  
      assert len(rdb_concat) == self.D
  
      return concatenate(rdb_concat, axis=3, name="LRLs_Concat")
  
file_path: image-super-resolution/ISR/models/rdn.py
imports: import tensorflow
  from tensorflow.keras.initializers import RandomUniform
  from tensorflow.keras.layers import concatenate, Input, Activation, Add, Conv2D, Lambda, UpSampling2D
  from tensorflow.keras.models import Model
  from ISR.models.imagemodel import ImageModel
label_desc: Use image node_id 5 for calling the RDN obj's underlying member method code with example usage: obj._RDBs(input_layer) and returns: concatenate