class_docstr: The Tuning objective for HPO.
docstr: Execute Training and return target metric in each trial.
  
  :param: trial: the trial object which provides the hyperparameter combinition.
  :return: the target metric value.
docstr_tok: ["Execute","Training","and","return","target","metric","in","each","trial",".",":","param",":","trial",":","the","trial","object","which","provides","the","hyperparameter","combinition",".",":","return",":","the","target","metric","value","."]
code: def __call__(self, trial):
      """
      Execute Training and return target metric in each trial.
  
      :param: trial: the trial object which provides the hyperparameter combinition.
      :return: the target metric value.
      """
      # Clear clutter from previous Keras session graphs.
      clear_session()
      # TODO may add data creator here, e.g. refresh data, reset generators, etc.
      # create model
      if _is_creator(self.model_):
          model = self.model_(trial)
      else:
          # copy model so that the original model is not changed
          # Need tests to check this path
          model = clone_model(self.model_)
  
      # fit
      new_kwargs = self._prepare_fit_args(trial)
      hist = model.fit(**new_kwargs)
  
      score = hist.history.get(self.target_metric, None)
      if score is not None:
          if isinstance(score, list):
              # score = score[-1]
              score = self.report_method(score)
          return score
  
file_path: BigDL/python/nano/src/bigdl/nano/automl/tf/objective.py
imports: from selectors import EpollSelector
  from tensorflow.keras.backend import clear_session
  from tensorflow.keras.models import clone_model
  import tensorflow
  import inspect
  import copy
  from bigdl.nano.automl.hpo.backend import create_tfkeras_pruning_callback
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 5 for calling the Objective obj's underlying member method code with example usage: obj.__call__(trial) and returns: score