class_docstr: Class for evaluating the performance of mapping W
class_docstr_tok: ["Class","for","evaluating","the","performance","of","mapping","W"]
docstr: Build a simple evaluation graph
  
  Arguments:
      name (str) : Name of the graph
      emb_ten (tensor): Embedding tensor
      query_ten (tensor): Query tensor
      knn (int): K value for NN
      en_knn (bool): enable or disable knn portion of the graph
      en_mean (bool): enable or disabel mean portion of the graph
  
  Returns:
      Returns a graph depending on booleans above
docstr_tok: ["Build","a","simple","evaluation","graph","Arguments",":","name","(","str",")",":","Name","of","the","graph","emb_ten","(","tensor",")",":","Embedding","tensor","query_ten","(","tensor",")",":","Query","tensor","knn","(","int",")",":","K","value","for","NN","en_knn","(","bool",")",":","enable","or","disable","knn","portion","of","the","graph","en_mean","(","bool",")",":","enable","or","disabel","mean","portion","of","the","graph","Returns",":","Returns","a","graph","depending","on","booleans","above"]
code: def build_eval_graph(
      self, name, emb_ten, query_ten, knn=100, en_knn=True, en_mean=True
  ):
      """
      Build a simple evaluation graph
  
      Arguments:
          name (str) : Name of the graph
          emb_ten (tensor): Embedding tensor
          query_ten (tensor): Query tensor
          knn (int): K value for NN
          en_knn (bool): enable or disable knn portion of the graph
          en_mean (bool): enable or disabel mean portion of the graph
  
      Returns:
          Returns a graph depending on booleans above
      """
      with tf.variable_scope(name, reuse=tf.AUTO_REUSE):
          # Look Up the words
          emb_lut = tf.nn.embedding_lookup(
              emb_ten, self.src_ph, name="EvalSrcLut"
          )
          query_lut = tf.nn.embedding_lookup(
              query_ten, self.tgt_ph, name="EvalTgtLut"
          )
          # Cast
          emb = tf.cast(emb_lut, tf.float32)
          query = tf.cast(query_lut, tf.float32)
          # MM
          sim_scores = tf.matmul(emb, tf.transpose(query))
          # Topk
          if en_knn and not en_mean:
              top_matches = tf.nn.top_k(sim_scores, knn)
              return top_matches
          if en_knn and en_mean:
              top_matches = tf.nn.top_k(sim_scores, knn)
              best_distances = tf.reduce_mean(top_matches[0], axis=1)
              return best_distances
          return sim_scores
  
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 4 for calling the Evaluate obj's underlying member method code with example usage: obj.build_eval_graph(name, emb_ten, query_ten, knn, en_knn, en_mean) and returns: sim_scores, top_matches, best_distances