code: def __init__(
      self,
      image_shape: Tuple,
      output_dim: int,
      base_kernel: gpflow.kernels.Kernel,
      batch_size: Optional[int] = None,
  ):
      super().__init__()
      with self.name_scope:
          self.base_kernel = base_kernel
          input_size = int(tf.reduce_prod(image_shape))
          input_shape = (input_size,)
  
          self.cnn = tf.keras.Sequential(
              [
                  tf.keras.layers.InputLayer(
                      input_shape=input_shape, batch_size=batch_size
                  ),
                  tf.keras.layers.Reshape(image_shape),
                  tf.keras.layers.Conv2D(
                      filters=32,
                      kernel_size=image_shape[:-1],
                      padding="same",
                      activation="relu",
                  ),
                  tf.keras.layers.MaxPool2D(
                      pool_size=(2, 2), strides=2
                  ),
                  tf.keras.layers.Conv2D(
                      filters=64,
                      kernel_size=(5, 5),
                      padding="same",
                      activation="relu",
                  ),
                  tf.keras.layers.MaxPool2D(
                      pool_size=(2, 2), strides=2
                  ),
                  tf.keras.layers.Flatten(),
                  tf.keras.layers.Dense(output_dim, activation="relu"),
                  tf.keras.layers.Lambda(to_default_float),
              ]
          )
  
          self.cnn.build()
  
file_path: GPflow/doc/sphinx/notebooks/tailor/gp_nn.pct.py
imports: from typing import Dict, Optional, Tuple
  import numpy
  import tensorflow
  import tensorflow_datasets
  from scipy.cluster.vq import kmeans2
  import gpflow
  from gpflow.ci_utils import reduce_in_tests
  from gpflow.utilities import to_default_float
label_desc: Use image node_id 1 to create a new KernelWithConvNN object from inherited base classes: gpflow.kernels with example: obj = KernelWithConvNN(image_shape, output_dim, base_kernel, batch_size)