class_docstr: LeNet-5 Model with customizable hyper-parameters
docstr: Initialize hyper-parameters.
  
  Parameters
  ----------
  conv_size : int
      Kernel size of convolutional layers.
  hidden_size : int
      Dimensionality of last hidden layer.
  dropout_rate : float
      Dropout rate between two fully connected (dense) layers, to prevent co-adaptation.
docstr_tok: ["Initialize","hyper-parameters",".","Parameters","--","--","--","--","--","conv_size",":","int","Kernel","size","of","convolutional","layers",".","hidden_size",":","int","Dimensionality","of","last","hidden","layer",".","dropout_rate",":","float","Dropout","rate","between","two","fully","connected","(","dense",")","layers",",","to","prevent","co-adaptation","."]
code: def __init__(self, conv_size, hidden_size, dropout_rate):
      """
      Initialize hyper-parameters.
  
      Parameters
      ----------
      conv_size : int
          Kernel size of convolutional layers.
      hidden_size : int
          Dimensionality of last hidden layer.
      dropout_rate : float
          Dropout rate between two fully connected (dense) layers, to prevent co-adaptation.
      """
      super().__init__()
      self.conv1 = Conv2D(
          filters=32, kernel_size=conv_size, activation="relu"
      )
      self.pool1 = MaxPool2D(pool_size=2)
      self.conv2 = Conv2D(
          filters=64, kernel_size=conv_size, activation="relu"
      )
      self.pool2 = MaxPool2D(pool_size=2)
      self.flatten = Flatten()
      self.fc1 = Dense(units=hidden_size, activation="relu")
      self.dropout = Dropout(rate=dropout_rate)
      self.fc2 = Dense(units=10, activation="softmax")
  
file_path: nni/examples/trials/mnist-tfv2/mnist.py
imports: import logging
  import tensorflow
  from tensorflow.keras import Model
  from tensorflow.keras.callbacks import Callback
  from tensorflow.keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPool2D
  from tensorflow.keras.optimizers import Adam
  import nni
label_desc: Use image node_id 1 to create a new MnistModel object from inherited base classes: Model with example: obj = MnistModel(conv_size, hidden_size, dropout_rate)