class_docstr: MNIST encoder used in the experiments for the Counterfactual with Reinforcement Learning. The model
  consists of 3 convolutional layers having 16, 8 and 8 channels and a kernel size of 3, with ReLU nonlinearities.
  Each convolutional layer is followed by a maxpooling layer of size 2. Finally, a fully connected layer
  follows the convolutional block with a tanh nonlinearity. The tanh clips the output between [-1, 1], required
  in the DDPG algorithm (e.g., [act_low, act_high]). The embedding dimension used in the paper is 32, although
  this can vary.
docstr: Constructor.
  
  Parameters
  ----------
  latent_dim
      Latent dimension.
docstr_tok: ["Constructor",".","Parameters","--","--","--","--","--","latent_dim","Latent","dimension","."]
code: def __init__(self, latent_dim: int, **kwargs) -> None:
      """
      Constructor.
  
      Parameters
      ----------
      latent_dim
          Latent dimension.
      """
      super().__init__(**kwargs)
  
      self.conv1 = keras.layers.Conv2D(
          16, 3, padding="same", activation="relu"
      )
      self.maxpool1 = keras.layers.MaxPool2D(
          pool_size=(2, 2), strides=2
      )
      self.conv2 = keras.layers.Conv2D(
          8, 3, padding="same", activation="relu"
      )
      self.maxpool2 = keras.layers.MaxPool2D(
          pool_size=(2, 2), strides=2
      )
      self.conv3 = keras.layers.Conv2D(
          8, 3, padding="same", activation="relu"
      )
      self.maxpool3 = keras.layers.MaxPool2D(
          pool_size=(2, 2), strides=2
      )
      self.flatten = keras.layers.Flatten()
      self.fc1 = keras.layers.Dense(latent_dim, activation="tanh")
  
imports: import tensorflow
  import tensorflow.keras
  from typing import List
label_desc: Use image node_id 1 to create a new MNISTEncoder object from inherited base classes: keras with example: obj = MNISTEncoder(latent_dim)