def model_compile(model,
                  optimizer="adam",
                  loss="sparse_categorical_crossentropy",
                  metrics=None):
  """Compile the model in Keras."""
  metrics = ["accuracy"] if metrics is None else metrics
  return model.compile(optimizer=optimizer,
                       loss=loss,
                       metrics=metrics)