class_docstr: Basic tests for Kernel function 
class_docstr_tok: ["Basic","tests","for","Kernel","function"]
docstr: Tests for the matern kernel. 
docstr_tok: ["Tests","for","the","matern","kernel","."]
code: def test_matern_kernel(self):
      """Tests for the matern kernel."""
      self.report("Tests for the Matern kernel.")
      for nu in self.nu_vals:
          kern = MaternKernel(
              self.data_1.shape[1],
              nu,
              self.matern_scale,
              self.dim_bandwidths,
          )
          K11 = (1.0 / kern.norm_constant) * kern(self.data_1)
          K22 = (1.0 / kern.norm_constant) * kern(self.data_2)
          K12 = (1.0 / kern.norm_constant) * kern(
              self.data_1, self.data_2
          )
          true_vals_11 = self._compute_matern_val_given_nu_scale(
              nu, self.matern_scale, self.scaled_distances_11
          )
          true_vals_22 = self._compute_matern_val_given_nu_scale(
              nu, self.matern_scale, self.scaled_distances_22
          )
          true_vals_12 = self._compute_matern_val_given_nu_scale(
              nu, self.matern_scale, self.scaled_distances_12
          )
          assert np.linalg.norm(true_vals_11 - K11) < 1e-10
          assert np.linalg.norm(true_vals_22 - K22) < 1e-10
          assert np.linalg.norm(true_vals_12 - K12) < 1e-10
  
file_path: dragonfly/dragonfly/gp/unittest_kernel.py
imports: from __future__ import absolute_import
  from __future__ import division
  import numpy
  from .kernel import Kernel, SEKernel, MaternKernel, PolyKernel, CoordinateProductKernel
  from ..utils.ancillary_utils import dicts_are_equal
  from ..utils.base_test_class import BaseTestClass, execute_tests
label_desc: Use image node_id 5 for calling the KernelBasicTestCase obj's underlying member method code with example usage: obj.test_matern_kernel() without return types