code: def model(X_train, Y_train, X_test, Y_test):
      """
      Model providing function:
  
      Create Keras model with double curly brackets dropped-in as needed.
      Return value has to be a valid python dictionary with two customary keys:
          - loss: Specify a numeric evaluation metric to be minimized
          - status: Just use STATUS_OK and see hyperopt documentation if not feasible
      The last one is optional, though recommended, namely:
          - model: specify the model just created so that we can later use it again.
      """
      model = Sequential()
      model.add(Dense(512, input_shape=(784,)))
      model.add(Activation("relu"))
      model.add(Dropout({{uniform(0, 1)}}))
      model.add(Dense({{choice([256, 512, 1024])}}))
      model.add(Activation("relu"))
      model.add(Dropout({{uniform(0, 1)}}))
      model.add(Dense(10))
      model.add(Activation("softmax"))
  
      rms = RMSprop()
      model.compile(
          loss="categorical_crossentropy",
          optimizer=rms,
          metrics=["accuracy"],
      )
  
      model.fit(
          X_train,
          Y_train,
          batch_size={{choice([64, 128])}},
          nb_epoch=1,
          verbose=2,
          validation_data=(X_test, Y_test),
      )
      score, acc = model.evaluate(X_test, Y_test, verbose=0)
      print("Test accuracy:", acc)
      return {"loss": -acc, "status": STATUS_OK, "model": model}
  
file_path: hyperas/examples/use_intermediate_functions.py
imports: from __future__ import print_function
  from hyperopt import Trials, STATUS_OK, tpe
  from hyperas import optim
  from hyperas.distributions import choice, uniform
  from keras.models import Sequential
  from keras.layers.core import Dense, Dropout, Activation
  from keras.optimizers import RMSprop
  from keras.datasets import mnist
  from keras.utils import np_utils
  import matplotlib.pyplot
label_desc: Use image node_id 3 for calling a global function with example usage: model(X_train, Y_train, X_test, Y_test) and returns: dict