class_docstr: A distance between neural networks based on solving a transportation problem. 
docstr: Gets the cost matrix for one set of distances. 
docstr_tok: ["Gets","the","cost","matrix","for","one","set","of","distances","."]
code: def _get_cost_matrix_for_fwd_or_bkwd(self, x1_dists, x2_dists):
      """Gets the cost matrix for one set of distances."""
      curr_cost_accumulation = np.zeros(
          (x1_dists.shape[0], x2_dists.shape[0])
      )
      for dim in range(x1_dists.shape[1]):
          curr_diffs = (
              x1_dists[:, dim][:, np.newaxis] - x2_dists[:, dim]
          )
          curr_dim_costs = self._conn_diff_cost_func(curr_diffs)
          curr_cost_accumulation += curr_dim_costs
      curr_cost_matrix = curr_cost_accumulation / float(
          x1_dists.shape[1]
      )
      return curr_cost_matrix
  
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 4 for calling the OTMANNDistanceComputer obj's underlying member method code with example usage: obj._get_cost_matrix_for_fwd_or_bkwd(x1_dists, x2_dists) and returns: curr_cost_matrix