code: def define_model(params):
      """
      Return compiled model using hyperparameters specified in args.
      """
      nin = 2
      nout = 1
      units = 10
      nhlay = 2
      act = params["act"]
      init = "glorot_normal"
      input = Input(shape=(nin,), dtype="float32", name="input")
      x = input
      for units in params["arch"]:
          x = Dense(units, kernel_initializer=init, activation=act)(x)
      output = Dense(
          nout,
          kernel_initializer=init,
          activation="sigmoid",
          name="output",
      )(x)
      model = Model(inputs=input, outputs=output)
  
      # Learning Algorithm
      lrinit = params["lrinit"]
      momentum = params["momentum"]
      lrdecay = params["lrdecay"]
      loss = {"output": "binary_crossentropy"}
      metrics = {"output": "accuracy"}
      loss_weights = {"output": 1.0}
      optimizer = SGD(lr=lrinit, momentum=momentum, decay=lrdecay)
      model.compile(
          optimizer=optimizer,
          loss=loss,
          metrics=metrics,
          loss_weights=loss_weights,
      )
      return model
  
file_path: sherpa/examples/parallel-examples/bianchini/bianchini.py
imports: from __future__ import print_function
  import numpy
  import sherpa
  from keras.models import Model
  from keras.layers import Dense, Input
  from keras.optimizers import SGD
label_desc: Use image node_id 2 for calling a global function with example usage: define_model(params) and returns: model