code: def create_model(x_train, y_train, x_test, y_test):
      
      layer_1_size = {{quniform(12, 256, 4)}}
      l1_dropout = {{uniform(0.001, 0.7)}}
      params = {
          'l1_size': layer_1_size,
          'l1_dropout': l1_dropout
      }
      num_classes = 10
      model = Sequential()
      model.add(Dense(int(layer_1_size), activation='relu'))
      model.add(Dropout(l1_dropout))
      model.add(Dense(num_classes, activation='softmax'))
      model.compile(loss='categorical_crossentropy',
                    optimizer=RMSprop(),
                    metrics=['accuracy'])
      model.fit(x_train, y_train, batch_size=128, epochs=10, validation_data=(x_test, y_test))
      score, acc = model.evaluate(x_test, y_test, verbose=0)
      out = {
          'loss': -acc,
          'score': score,
          'status': STATUS_OK,
          'model_params': params,
      }
      # optionally store a dump of your model here so you can get it from the database later
      temp_name = tempfile.gettempdir()+'/'+next(tempfile._get_candidate_names()) + '.h5'
      model.save(temp_name)
      with open(temp_name, 'rb') as infile:
          model_bytes = infile.read()
      out['model_serial'] = model_bytes
      return out
docs: Create your model...