class_docstr: The ChangePoints kernel defines a fixed number of change-points along a 1d
  input space where different kernels govern different parts of the space.
  
  The kernel is by multiplication and addition of the base kernels with
  sigmoid functions (σ). A single change-point kernel is defined as::
  
      K₁(x, x') * (1 - σ(x)) * (1 - σ(x')) + K₂(x, x') * σ(x) * σ(x')
  
  where K₁ is deactivated around the change-point and K₂ is activated. The
  single change-point version can be found in :cite:t:`lloyd2014`. Each sigmoid
  is a logistic function defined as::
  
      σ(x) = 1 / (1 + exp{-s(x - x₀)})
  
  parameterized by location "x₀" and steepness "s".
  
  The key reference is :cite:t:`lloyd2014`.
code: def K_diag(self, X: tf.Tensor) -> tf.Tensor:
      cs(
          X,
          "[batch..., N, 1]  # The `ChangePoints` kernel requires a 1D input space.",
      )
  
      batch = tf.shape(X)[:-2]
      N = tf.shape(X)[-2]
      Ncp = tf.shape(self.locations)[0]
  
      sig_X = cs(
          tf.reshape(
              self._sigmoids(X), tf.concat([batch, [N, Ncp]], 0)
          ),
          "[batch..., N, Ncp]",
      )
  
      ones = tf.ones(tf.concat([batch, [N, 1]], 0), dtype=X.dtype)
      starters = cs(
          tf.concat([ones, sig_X * sig_X], axis=-1),
          "[batch..., N, Nkern]",
      )
      stoppers = cs(
          tf.concat([(1 - sig_X) * (1 - sig_X), ones], axis=-1),
          "[batch..., N, Nkern]",
      )
  
      kernel_stack = cs(
          tf.stack(
              [k(X, full_cov=False) for k in self.kernels], axis=-1
          ),
          "[batch..., N, Nkern]",
      )
      return tf.reduce_sum(kernel_stack * starters * stoppers, axis=-1)
  
file_path: GPflow/gpflow/kernels/changepoints.py
imports: from typing import Optional, Sequence
  import tensorflow
  from check_shapes import check_shape
  from check_shapes import check_shapes, inherit_check_shapes
  from ..base import Parameter, TensorType
  from ..utilities import positive
  from .base import Combination, Kernel
label_desc: Use image node_id 4 for calling the ChangePoints obj's underlying member method code with example usage: obj.K_diag(X) and returns: tf