code: def __init__(self, n_units, n_vocab, encoder, max_memory, hops):
      super(MemNN, self).__init__()
  
      with self.init_scope():
          self.embeds = chainer.ChainList()
          self.temporals = chainer.ChainList()
  
      normal = initializers.Normal()
      # Shares both embeded matrixes in adjacent layres
      for _ in six.moves.range(hops + 1):
          self.embeds.append(
              L.EmbedID(n_vocab, n_units, initialW=normal)
          )
          self.temporals.append(
              L.EmbedID(max_memory, n_units, initialW=normal)
          )
  
      self.memories = [
          Memory(
              self.embeds[i],
              self.embeds[i + 1],
              self.temporals[i],
              self.temporals[i + 1],
              encoder,
          )
          for i in six.moves.range(hops)
      ]
      # The question embedding is same as the input embedding of the
      # first layer
      self.B = self.embeds[0]
      # The answer prediction matrix W is same as the final output layer
      self.W = lambda u: F.linear(u, self.embeds[-1].W)
  
      self.encoder = encoder
  
      self.n_units = n_units
      self.max_memory = max_memory
      self.hops = hops
  
imports: import collections
  import json
  import os
  import numpy
  import six
  import chainer
  from chainer import backend
  import chainer.functions
  from chainer import initializers
  import chainer.links
  import babi
label_desc: Use image node_id 1 to create a new MemNN object from inherited base classes: chainer with example: obj = MemNN(n_units, n_vocab, encoder, max_memory, hops)