class_docstr: .. note:: `bigdl.dllib.keras` is deprecated in 0.11.
  This will be removed in future releases.
class_docstr_tok: ["..","note",":",":","`","bigdl.dllib.keras","`","is","deprecated","in","0.11",".","This","will","be","removed","in","future","releases","."]
docstr: Configures the learning process. Must be called before fit or evaluate.
  
  # Arguments
  optimizer: Optimization method to be used. One can alternatively pass in the corresponding
             string representation, such as 'sgd'.
  loss: Criterion to be used. One can alternatively pass in the corresponding string
        representation, such as 'mse'.
  metrics: List of validation methods to be used. Default is None. One can alternatively use
  ['accuracy'].
docstr_tok: ["Configures","the","learning","process",".","Must","be","called","before","fit","or","evaluate",".","#","Arguments","optimizer",":","Optimization","method","to","be","used",".","One","can","alternatively","pass","in","the","corresponding","string","representation",",","such","as","'sgd","'",".","loss",":","Criterion","to","be","used",".","One","can","alternatively","pass","in","the","corresponding","string","representation",",","such","as","'mse","'",".","metrics",":","List","of","validation","methods","to","be","used",".","Default","is","None",".","One","can","alternatively","use","[","'accuracy","'","]","."]
code: def compile(self, optimizer, loss, metrics=None):
      """
      Configures the learning process. Must be called before fit or evaluate.
  
      # Arguments
      optimizer: Optimization method to be used. One can alternatively pass in the corresponding
                 string representation, such as 'sgd'.
      loss: Criterion to be used. One can alternatively pass in the corresponding string
            representation, such as 'mse'.
      metrics: List of validation methods to be used. Default is None. One can alternatively use
      ['accuracy'].
      """
      if isinstance(optimizer, six.string_types):
          optimizer = self.__convert_optim_method(optimizer)
      if isinstance(loss, six.string_types):
          loss = self.__convert_criterion(loss)
      if all(
          isinstance(metric, six.string_types) for metric in metrics
      ):
          metrics = self.__convert_metrics(metrics)
      callBigDlFunc(
          self.bigdl_type,
          "compile",
          self.value,
          optimizer,
          loss,
          metrics,
      )
  
imports: from bigdl.dllib.nn.keras.layers.layer import KerasLayer
  from bigdl.dllib.optim.optimizer import *
  from bigdl.dllib.nn.criterion import *
  from bigdl.dllib.utils.log4Error import *
  import multiprocessing
  import warnings
  from bigdl.dllib.nn.layer import SharedStaticUtils, Container
label_desc: Use image node_id 4 for calling the KerasModel obj's underlying member method code with example usage: obj.compile(optimizer, loss, metrics) without return types