class_docstr: Class for evaluating the performance of mapping W
class_docstr_tok: ["Class","for","evaluating","the","performance","of","mapping","W"]
docstr: Calculates average distance between two embeddings
  Arguments:
      sess(tf.session): Tensorflow session
      batch_size(int): batch_size
  Returns:
      Returns numpy array of average values of size vocab_size
docstr_tok: ["Calculates","average","distance","between","two","embeddings","Arguments",":","sess","(","tf.session",")",":","Tensorflow","session","batch_size","(","int",")",":","batch_size","Returns",":","Returns","numpy","array","of","average","values","of","size","vocab_size"]
code: def calc_avg_dist(self, sess, batch_size=512):
      """
      Calculates average distance between two embeddings
      Arguments:
          sess(tf.session): Tensorflow session
          batch_size(int): batch_size
      Returns:
          Returns numpy array of average values of size vocab_size
      """
      avg1_val = []
      avg2_val = []
  
      # Calculate Average
      for i in range(0, self.vocab_size, batch_size):
          avg_src_ids = [
              x for x in range(i, min(i + batch_size, self.vocab_size))
          ]
          avg1_dict = {
              self.src_ph: avg_src_ids,
              self.tgt_ph: self.tgt_ids,
          }
          avg1_val.append(
              sess.run(
                  self.csls_subgraphs["Avg1S2T"], feed_dict=avg1_dict
              )
          )
          avg2_val.append(
              sess.run(
                  self.csls_subgraphs["Avg2S2T"], feed_dict=avg1_dict
              )
          )
      avg1_val = np.concatenate(avg1_val)
      avg2_val = np.concatenate(avg2_val)
      return avg1_val, avg2_val
  
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 10 for calling the Evaluate obj's underlying member method code with example usage: obj.calc_avg_dist(sess, batch_size) and returns: avg1_val,  avg2_val