class_docstr: Class for evaluating the performance of mapping W
class_docstr_tok: ["Class","for","evaluating","the","performance","of","mapping","W"]
docstr: Evaluates accuracy of mapping using Nearest neighbors
  Arguments:
      sess(tf.session): Tensorflow Session
      batch_size(int): Size of batch
docstr_tok: ["Evaluates","accuracy","of","mapping","using","Nearest","neighbors","Arguments",":","sess","(","tf.session",")",":","Tensorflow","Session","batch_size","(","int",")",":","Size","of","batch"]
code: def calc_nn_acc(self, sess, batch_size=512):
      """
      Evaluates accuracy of mapping using Nearest neighbors
      Arguments:
          sess(tf.session): Tensorflow Session
          batch_size(int): Size of batch
      """
      top_matches = []
      eval_size = len(self.src_ind)
  
      # Loop through all the eval dataset
      for i in range(0, eval_size, batch_size):
          src_ids = [
              self.src_ind[x]
              for x in range(i, min(i + batch_size, eval_size))
          ]
          eval_dict = {self.src_ph: src_ids, self.tgt_ph: self.tgt_ids}
          matches = sess.run(self.eval_nn, feed_dict=eval_dict)
          top_matches.append(matches[1])
      top_matches = np.concatenate(top_matches)
  
      print("Accuracy using Nearest Neighbors is")
      self.calc_accuracy(top_matches)
  
file_path: nlp-architect/examples/crosslingembs/evaluate.py
imports: from __future__ import print_function, division
  import numpy
  import tensorflow
  from nlp_architect.data.fasttext_emb import get_eval_data
label_desc: Use image node_id 7 for calling the Evaluate obj's underlying member method code with example usage: obj.calc_nn_acc(sess, batch_size) without return types