class_docstr: Unit tests for the Transport NNKernels. 
docstr: Testing instantiation. 
docstr_tok: ["Testing","instantiation","."]
code: def test_instantiation(self):
      """Testing instantiation."""
      self.report(
          "Testing instantiation of DistProdNNKernelTestCase and computation "
          + "for specific networks."
      )
      dist_type_vals = ["lp", "emd", "lp-emd"]
      all_kernels = []
      for dist_type in dist_type_vals:
          if dist_type == "lp":
              betas = self.lp_betas
          elif dist_type == "emd":
              betas = self.emd_betas
          else:
              betas = [
                  j
                  for i in zip(self.lp_betas, self.emd_betas)
                  for j in i
              ]
          tp_kernel = otmann.get_otmann_kernel_from_params(
              "prod",
              self.all_layer_labels,
              self.label_mismatch_penalty,
              self.non_assignment_penalty,
              otmann.CNN_STRUCTURAL_PENALTY_GROUPS,
              otmann.PATH_LENGTH_TYPES,
              self.mislabel_coeffs,
              self.struct_coeffs,
              dist_type,
              betas,
              self.scale,
          )
          cnn_K = tp_kernel(self.cnns)
          all_kernels.append(cnn_K)
          cnn_eig_vals, _ = np.linalg.eig(cnn_K)
          self.report(
              "dist-type: %s, eigvals: %s."
              % (
                  dist_type,
                  get_list_of_floats_as_str(sorted(cnn_eig_vals)),
              )
          )
          self.report(
              "%s transport kernel:\n%s"
              % (dist_type, str(np.round(cnn_K, 3))),
              "test_result",
          )
          assert cnn_K.shape == (len(self.cnns), len(self.cnns))
          assert np.all(np.diag(cnn_K) == 1)
      # Check if it is in fact the product
      if (
          "lp" in dist_type_vals
          and "emd" in dist_type_vals
          and "lp-emd" in dist_type_vals
      ):
          lp_kernel = all_kernels[dist_type_vals.index("lp")]
          emd_kernel = all_kernels[dist_type_vals.index("emd")]
          lpemd_kernel = all_kernels[dist_type_vals.index("lp-emd")]
          assert (
              np.linalg.norm(lpemd_kernel - lp_kernel * emd_kernel)
              < _TOL
          )
  
imports: import numpy
  from .None import otmann
  from .unittest_neural_network import generate_cnn_architectures, generate_mlp_architectures
  from ..utils.ancillary_utils import get_list_of_floats_as_str
  from ..utils.base_test_class import BaseTestClass, execute_tests
label_desc: Use image node_id 2 for calling the DistProdNNKernelTestCase obj's underlying member method code with example usage: obj.test_instantiation() without return types