class_docstr: An abstract class for computing distances between neural networks. 
docstr: Evaluates the distances between X1 and X2 and returns an n1 x n2 distance matrix.
  If X1 and X2 are single neural networks, returns a scalar. 
docstr_tok: ["Evaluates","the","distances","between","X1","and","X2","and","returns","an","n1","x","n2","distance","matrix",".","If","X1","and","X2","are","single","neural","networks",",","returns","a","scalar","."]
code: def evaluate(self, X1, X2, *args, **kwargs):
      """Evaluates the distances between X1 and X2 and returns an n1 x n2 distance matrix.
      If X1 and X2 are single neural networks, returns a scalar."""
      if isinstance(X1, neural_network.NeuralNetwork) and isinstance(
          X2, neural_network.NeuralNetwork
      ):
          return self.evaluate_single(X1, X2, *args, **kwargs)
      else:
          n1 = len(X1)
          n2 = len(X2)
          X2 = X2 if X2 is not None else X1
          x1_is_x2 = X1 is X2
  
          all_ret = None
          es_is_iterable = None
          for i, x1 in enumerate(X1):
              X2_idxs = range(i, n2) if x1_is_x2 else range(n2)
              for j in X2_idxs:
                  x2 = X2[j]
                  # Compute the distances
                  curr_ret = self.evaluate_single(
                      x1, x2, *args, **kwargs
                  )
                  all_ret, es_is_iterable = self._add_to_all_ret(
                      curr_ret, i, j, n1, n2, all_ret, es_is_iterable
                  )
                  # Check if we need to do j and i as well.
                  if x1_is_x2:
                      all_ret, es_is_iterable = self._add_to_all_ret(
                          curr_ret,
                          j,
                          i,
                          n1,
                          n2,
                          all_ret,
                          es_is_iterable,
                      )
          #       if all_ret is not None:
          #         print "Computed %d distances between %d and %d (%d) networks."%(
          #                 len(all_ret), len(X1), len(X2), X1 is X2)
          return all_ret
  
imports: import numpy
  from .None import neural_network
  from ..gp.kernel import ExpSumOfDistsKernel, SumOfExpSumOfDistsKernel
  from ..utils.oper_utils import opt_transport
label_desc: Use image node_id 3 for calling the NNDistanceComputer obj's underlying member method code with example usage: obj.evaluate(X1, X2) and returns: self, all_ret