class_docstr: Memory Network agent.
  
  Tips:
  - time features are necessary when memory order matters
  - multiple hops allow multiple steps of reasoning, but also seem to make it
      easier to learn to read the memories if you have at least two hops
  - 'adam' seems to work very poorly compared to 'sgd' for hogwild training
class_docstr_tok: ["Memory","Network","agent",".","Tips",":","-","time","features","are","necessary","when","memory","order","matters","-","multiple","hops","allow","multiple","steps","of","reasoning",",","but","also","seem","to","make","it","easier","to","learn","to","read","the","memories","if","you","have","at","least","two","hops","-","'adam","'","seems","to","work","very","poorly","compared","to","'sgd","'","for","hogwild","training"]
code: def add_cmdline_args(
      cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
  ) -> ParlaiParser:
      arg_group = parser.add_argument_group("MemNN Arguments")
      arg_group.add_argument(
          "-esz",
          "--embedding-size",
          type=int,
          default=128,
          help="size of token embeddings",
      )
      arg_group.add_argument(
          "-hops",
          "--hops",
          type=int,
          default=3,
          help="number of memory hops",
      )
      arg_group.add_argument(
          "--memsize",
          type=int,
          default=32,
          help='size of memory, set to 0 for "nomemnn" model which just '
          "embeds query and candidates and picks most similar candidate",
      )
      arg_group.add_argument(
          "-tf",
          "--time-features",
          type="bool",
          default=True,
          help="use time features for memory embeddings",
      )
      arg_group.add_argument(
          "-pe",
          "--position-encoding",
          type="bool",
          default=False,
          help="use position encoding instead of bag of words embedding",
      )
      parser.set_defaults(
          split_lines=True,
          add_p1_after_newln=True,
          encode_candidate_vecs=True,
      )
      super().add_cmdline_args(parser, partial_opt=partial_opt)
      cls.dictionary_class().add_cmdline_args(
          parser, partial_opt=partial_opt
      )
      return arg_group
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from functools import lru_cache
  import torch
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  from .modules import MemNN, opt_to_kwargs
label_desc: Use image node_id 1 for calling the MemnnAgent obj's underlying member method code with example usage: obj.add_cmdline_args(cls, parser, partial_opt) and returns: arg_group