code: def build_model(class_num):
      model = Sequential()
      model.add(Reshape((1, 28, 28), input_shape=(28, 28, 1)))
      model.add(
          Convolution2D(6, 5, 5, activation="tanh", name="conv1_5x5")
      )
      model.add(MaxPooling2D())
      model.add(
          Convolution2D(12, 5, 5, activation="tanh", name="conv2_5x5")
      )
      model.add(MaxPooling2D())
      model.add(Flatten())
      model.add(Dense(100, activation="tanh", name="fc1"))
      model.add(Dense(class_num, activation="softmax", name="fc2"))
      return model
  
imports: from optparse import OptionParser
  import bigdl.dllib.keras.Sequential
  from bigdl.dllib.keras.layers import *
  from bigdl.dllib.feature.dataset import mnist
label_desc: Use image node_id 1 for calling a global function with example usage: build_model(class_num) and returns: model