class_docstr: DIIN model.
  
  Examples:
      >>> model = DIIN()
      >>> model.guess_and_fill_missing_params()
      >>> model.params['embedding_input_dim'] = 10000
      >>> model.params['embedding_output_dim'] = 300
      >>> model.params['embedding_trainable'] = True
      >>> model.params['optimizer'] = 'adam'
      >>> model.params['dropout_initial_keep_rate'] = 1.0
      >>> model.params['dropout_decay_interval'] = 10000
      >>> model.params['dropout_decay_rate'] = 0.977
      >>> model.params['char_embedding_input_dim'] = 100
      >>> model.params['char_embedding_output_dim'] = 8
      >>> model.params['char_conv_filters'] = 100
      >>> model.params['char_conv_kernel_size'] = 5
      >>> model.params['first_scale_down_ratio'] = 0.3
      >>> model.params['nb_dense_blocks'] = 3
      >>> model.params['layers_per_dense_block'] = 8
      >>> model.params['growth_rate'] = 20
      >>> model.params['transition_scale_down_ratio'] = 0.5
      >>> model.build()
class_docstr_tok: ["DIIN","model",".","Examples",":",">",">",">","model","=","DIIN","(",")",">",">",">","model.guess_and_fill_missing_params","(",")",">",">",">","model.params","[","'embedding_input_dim","'","]","=","10000",">",">",">","model.params","[","'embedding_output_dim","'","]","=","300",">",">",">","model.params","[","'embedding_trainable","'","]","=","True",">",">",">","model.params","[","'optimizer","'","]","=","'adam'",">",">",">","model.params","[","'dropout_initial_keep_rate","'","]","=","1.0",">",">",">","model.params","[","'dropout_decay_interval","'","]","=","10000",">",">",">","model.params","[","'dropout_decay_rate","'","]","=","0.977",">",">",">","model.params","[","'char_embedding_input_dim","'","]","=","100",">",">",">","model.params","[","'char_embedding_output_dim","'","]","=","8",">",">",">","model.params","[","'char_conv_filters","'","]","=","100",">",">",">","model.params","[","'char_conv_kernel_size","'","]","=","5",">",">",">","model.params","[","'first_scale_down_ratio","'","]","=","0.3",">",">",">","model.params","[","'nb_dense_blocks","'","]","=","3",">",">",">","model.params","[","'layers_per_dense_block","'","]","=","8",">",">",">","model.params","[","'growth_rate","'","]","=","20",">",">",">","model.params","[","'transition_scale_down_ratio","'","]","=","0.5",">",">",">","model.build","(",")"]
docstr: DenseNet is consisted of 'nb_dense_blocks' sets of Dense block
  and Transition block pair.
  
  :return: Wrapper Keras 'Layer' as DenseNet, tensor in tensor out.
docstr_tok: ["DenseNet","is","consisted","of","'nb_dense_blocks","'","sets","of","Dense","block","and","Transition","block","pair",".",":","return",":","Wrapper","Keras","'Layer","'","as","DenseNet",",","tensor","in","tensor","out","."]
code: def _create_densenet(self) -> typing.Callable:
      """
      DenseNet is consisted of 'nb_dense_blocks' sets of Dense block
      and Transition block pair.
  
      :return: Wrapper Keras 'Layer' as DenseNet, tensor in tensor out.
      """
  
      def _wrapper(x):
          for _ in range(self._params["nb_dense_blocks"]):
              # Dense block
              # Apply 'layers_per_dense_block' convolution layers.
              for _ in range(self._params["layers_per_dense_block"]):
                  out_conv = keras.layers.Conv2D(
                      filters=self._params["growth_rate"],
                      kernel_size=(3, 3),
                      padding="same",
                      activation="relu",
                  )(x)
                  x = keras.layers.Concatenate(axis=-1)([x, out_conv])
  
              # Transition block
              # Apply a convolution layer and a maxpooling layer.
              scale_down_ratio = self._params[
                  "transition_scale_down_ratio"
              ]
              nb_filter = int(K.int_shape(x)[-1] * scale_down_ratio)
              x = keras.layers.Conv2D(
                  filters=nb_filter,
                  kernel_size=(1, 1),
                  padding="same",
                  activation=None,
              )(x)
              x = keras.layers.MaxPool2D(strides=(2, 2))(x)
  
          out_densenet = keras.layers.Flatten()(x)
          return out_densenet
  
      return _wrapper
  
imports: import typing
  import keras
  import keras.backend
  import tensorflow
  from matchzoo import preprocessors
  from matchzoo.contrib.layers import DecayingDropoutLayer
  from matchzoo.contrib.layers import EncodingLayer
  from matchzoo.engine import hyper_spaces
  from matchzoo.engine.base_model import BaseModel
  from matchzoo.engine.param import Param
  from matchzoo.engine.param_table import ParamTable
label_desc: Use image node_id 8 for calling the DIIN obj's underlying member method code with example usage: obj._create_densenet() and returns: _wrapper, out_densenet