class_docstr: An implementation of multi-layer end-to-end memory network,
  with RNN-like weight tying described in
  (Sukhbaatar et al.) End-To-End Memory Networks .
  
  See :meth:`~texar.tf.modules.MemNetBase.get_default_embed_fn` for default
  embedding functions. Customized embedding functions must follow
  the same signature.
  
  Args:
      raw_memory_dim (int): Dimension size of raw memory entries
          (before embedding). For example,
          if a raw memory entry is a word, this is the **vocabulary size**
          (imagine a one-hot representation of word). If a raw memory entry
          is a dense vector, this is the dimension size of the vector.
      input_embed_fn (optional): A callable that embeds raw memory entries
          as inputs.
          This corresponds to the `A` embedding operation in
          (Sukhbaatar et al.)
          If not provided, a default embedding operation is created as
          specified in :attr:`hparams`. See
          :meth:`~texar.tf.modules.MemNetBase.get_default_embed_fn`
          for details.
      output_embed_fn (optional): A callable that embeds raw memory entries
          as outputs.
          This corresponds to the `C` embedding operation in
          (Sukhbaatar et al.)
          If not provided, a default embedding operation is created as
          specified in :attr:`hparams`. See
          :meth:`~texar.tf.modules.MemNetBase.get_default_embed_fn`
          for details.
      query_embed_fn (optional): A callable that embeds query.
          This corresponds to the `B` embedding operation in
          (Sukhbaatar et al.). If not provided and "use_B" is True
          in :attr:`hparams`, a default embedding operation is created as
          specified in :attr:`hparams`. See
          :meth:`~texar.tf.modules.MemNetBase.get_default_embed_fn`
          for details.
          For customized query_embed_fn, note that the function must follow
          the signature of the default embed_fn where `memory_size` must
          be 1.
      hparams (dict or HParams, optional): Hyperparameters. Missing
          hyperparamerter will be set to default values. See
          :meth:`default_hparams` for the hyperparameter sturcture and
          default values.
docstr: Returns a dictionary of hyperparameters with default values.
  
  .. code-block:: python
  
      {
          "n_hops": 1,
          "memory_dim": 100,
          "relu_dim": 50,
          "memory_size": 100,
          "A": default_embed_fn_hparams,
          "C": default_embed_fn_hparams,
          "B": default_embed_fn_hparams,
          "use_B": False,
          "use_H": True,
          "dropout_rate": 0,
          "variational": False,
          "name": "memnet_rnnlike",
      }
  
  Here:
  
  "n_hops": int
      Number of hops.
  
  "memory_dim": int
      Memory dimension, i.e., the dimension size of a memory entry
      embedding. Ignored if at least one of the embedding functions is
      created according to :attr:`hparams`. In this case
      :attr:`memory_dim` is inferred from the created embed_fn.
  
  "relu_dim": int
      Number of elements in :attr:`memory_dim` that have relu at the end
      of each hop.
      Should be not less than 0 and not more than :attr`memory_dim`.
  
  "memory_size": int
      Number of entries in memory.
  
      For example, the number of sentences {x_i} in Fig.1(a) of
      (Sukhbaatar et al.) End-To-End Memory Networks.
  
  "use_B": bool
      Whether to create the query embedding function. Ignored if
      `query_embed_fn` is given to the constructor.
  
  "use_H": bool
      Whether to perform a linear transformation with matrix `H` at
      the end of each A-C layer.
  
  "dropout_rate": float
      The dropout rate to apply to the output of each hop. Should
      be between 0 and 1.
      E.g., `dropout_rate=0.1` would drop out 10% of the units.
  
  "variational": bool
      Whether to share dropout masks after each hop.
docstr_tok: ["Returns","a","dictionary","of","hyperparameters","with","default","values",".","..","code-block",":",":","python","{","``","n_hops","''",":","1",",","``","memory_dim","''",":","100",",","``","relu_dim","''",":","50",",","``","memory_size","''",":","100",",","``","A","''",":","default_embed_fn_hparams",",","``","C","''",":","default_embed_fn_hparams",",","``","B","''",":","default_embed_fn_hparams",",","``","use_B","''",":","False",",","``","use_H","''",":","True",",","``","dropout_rate","''",":","0",",","``","variational","''",":","False",",","``","name","''",":","``","memnet_rnnlike","''",",","}","Here",":","''","n_hops","''",":","int","Number","of","hops",".","``","memory_dim","''",":","int","Memory","dimension",",","i.e.",",","the","dimension","size","of","a","memory","entry","embedding",".","Ignored","if","at","least","one","of","the","embedding","functions","is","created","according","to",":","attr",":","`","hparams","`",".","In","this","case",":","attr",":","`","memory_dim","`","is","inferred","from","the","created","embed_fn",".","``","relu_dim","''",":","int","Number","of","elements","in",":","attr",":","`","memory_dim","`","that","have","relu","at","the","end","of","each","hop",".","Should","be","not","less","than","0","and","not","more","than",":","attr","`","memory_dim","`",".","``","memory_size","''",":","int","Number","of","entries","in","memory",".","For","example",",","the","number","of","sentences","{","x_i","}","in","Fig.1","(","a",")","of","(","Sukhbaatar","et","al",".",")","End-To-End","Memory","Networks",".","``","use_B","''",":","bool","Whether","to","create","the","query","embedding","function",".","Ignored","if","`","query_embed_fn","`","is","given","to","the","constructor",".","``","use_H","''",":","bool","Whether","to","perform","a","linear","transformation","with","matrix","`","H","`","at","the","end","of","each","A-C","layer",".","``","dropout_rate","''",":","float","The","dropout","rate","to","apply","to","the","output","of","each","hop",".","Should","be","between","0","and","1",".","E.g.",",","`","dropout_rate=0.1","`","would","drop","out","10","%","of","the","units",".","``","variational","''",":","bool","Whether","to","share","dropout","masks","after","each","hop","."]
code: def default_hparams():
      """Returns a dictionary of hyperparameters with default values.
  
      .. code-block:: python
  
          {
              "n_hops": 1,
              "memory_dim": 100,
              "relu_dim": 50,
              "memory_size": 100,
              "A": default_embed_fn_hparams,
              "C": default_embed_fn_hparams,
              "B": default_embed_fn_hparams,
              "use_B": False,
              "use_H": True,
              "dropout_rate": 0,
              "variational": False,
              "name": "memnet_rnnlike",
          }
  
      Here:
  
      "n_hops": int
          Number of hops.
  
      "memory_dim": int
          Memory dimension, i.e., the dimension size of a memory entry
          embedding. Ignored if at least one of the embedding functions is
          created according to :attr:`hparams`. In this case
          :attr:`memory_dim` is inferred from the created embed_fn.
  
      "relu_dim": int
          Number of elements in :attr:`memory_dim` that have relu at the end
          of each hop.
          Should be not less than 0 and not more than :attr`memory_dim`.
  
      "memory_size": int
          Number of entries in memory.
  
          For example, the number of sentences {x_i} in Fig.1(a) of
          (Sukhbaatar et al.) End-To-End Memory Networks.
  
      "use_B": bool
          Whether to create the query embedding function. Ignored if
          `query_embed_fn` is given to the constructor.
  
      "use_H": bool
          Whether to perform a linear transformation with matrix `H` at
          the end of each A-C layer.
  
      "dropout_rate": float
          The dropout rate to apply to the output of each hop. Should
          be between 0 and 1.
          E.g., `dropout_rate=0.1` would drop out 10% of the units.
  
      "variational": bool
          Whether to share dropout masks after each hop.
      """
      hparams = MemNetBase.default_hparams()
      hparams.update({"use_H": True, "name": "memnet_rnnlike"})
      return hparams
  
imports: import tensorflow
  from texar.tf.module_base import ModuleBase
  from texar.tf.modules.embedders import WordEmbedder, PositionEmbedder
  from texar.tf.utils.mode import switch_dropout
  from texar.tf.modules.memory.embed_fns import default_memnet_embed_fn_hparams
label_desc: Use image node_id 2 for calling the MemNetRNNLike obj's underlying member method code with example usage: obj.default_hparams() and returns: hparams