docstr: Adds tensor operations for computing scores.
  
  Computes prediction yhat (eqn (1) in Matching networks) of class for test
  compounds.
docstr_tok: ["Adds","tensor","operations","for","computing","scores",".","Computes","prediction","yhat","(","eqn","(","1",")","in","Matching","networks",")","of","class","for","test","compounds","."]
code: def get_scores(self):
      """Adds tensor operations for computing scores.
  
      Computes prediction yhat (eqn (1) in Matching networks) of class for test
      compounds.
      """
      # Get featurization for test
      # Shape (n_test, n_feat)
      test_feat = self.model.get_test_output()
      # Get featurization for support
      # Shape (n_support, n_feat)
      support_feat = self.model.get_support_output()
  
      # Computes the inner part c() of the kernel
      # (the inset equation in section 2.1.1 of Matching networks paper).
      # Normalize
      if self.similarity == "cosine":
          g = model_ops.cosine_distances(test_feat, support_feat)
      else:
          raise ValueError("Only cosine similarity is supported.")
      # TODO(rbharath): euclidean kernel is broken!
      # elif self.similarity == 'euclidean':
      #  g = model_ops.euclidean_distance(test_feat, support_feat)
      # Note that gram matrix g has shape (n_test, n_support)
  
      # soft corresponds to a(xhat, x_i) in eqn (1) of Matching Networks paper
      # https://arxiv.org/pdf/1606.04080v1.pdf
      # Computes softmax across axis 1, (so sums distances to support set for
      # each test entry) to get attention vector
      # Shape (n_test, n_support)
      attention = tf.nn.softmax(g)  # Renormalize
  
      # Weighted sum of support labels
      # Shape (n_support, 1)
      support_labels = tf.expand_dims(self.support_label_placeholder, 1)
      # pred is yhat in eqn (1) of Matching Networks.
      # Shape squeeze((n_test, n_support) * (n_support, 1)) = (n_test,)
      pred = tf.squeeze(tf.matmul(attention, support_labels), [1])
  
      # Clip softmax probabilities to range [epsilon, 1-epsilon]
      # Shape (n_test,)
      pred = tf.clip_by_value(pred, 1e-7, 1.0 - 1e-7)
  
      # Convert to logit space using inverse sigmoid (logit) function
      # logit function: log(pred) - log(1-pred)
      # Used to invoke tf.nn.sigmoid_cross_entropy_with_logits
      # in Cross Entropy calculation.
      # Shape (n_test,)
      scores = tf.log(pred) - tf.log(
          tf.constant(1.0, dtype=tf.float32) - pred
      )
  
      return pred, scores
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import unicode_literals
  import warnings
  import numpy
  import tensorflow
  import sys
  import time
  from deepchem.models import Model
  from deepchem.data import pad_batch
  from deepchem.data import NumpyDataset
  from deepchem.metrics import to_one_hot
  from deepchem.metrics import from_one_hot
  from deepchem.models.tf_new_models.graph_topology import merge_dicts
  from deepchem.nn import model_ops
  from deepchem.data import SupportGenerator
  from deepchem.data import EpisodeGenerator
  from deepchem.data import get_task_dataset
  from deepchem.data import get_single_task_test
  from deepchem.data import get_task_dataset_minus_support
  from deepchem.nn.copy import Input
label_desc: Use image node_id 8 for calling the SupportGraphClassifier obj's underlying member method code with example usage: obj.get_scores() and returns: pred,  scores