class_docstr: A Minin object to add hpo related methods to models.
  
  It is used to add hpo related search methods onto
  tf.keras.Sequential, tf.keras.Model, as well as custom
      model subclassing from tf.keras.Model.
class_docstr_tok: ["A","Minin","object","to","add","hpo","related","methods","to","models",".","It","is","used","to","add","hpo","related","search","methods","onto","tf.keras.Sequential",",","tf.keras.Model",",","as","well","as","custom","model","subclassing","from","tf.keras.Model","."]
code: def _get_model_builder(
      model_init_args_func,
      model_init_args_func_kwargs,
      modelcls,
      compile_args,
      compile_kwargs,
      backend,
  ):
      def model_builder(trial):
          model = modelcls(
              **model_init_args_func(
                  trial, **model_init_args_func_kwargs
              )
          )
          # self._model_compile(model, trial)
          # instantiate optimizers if it is autoobj
          optimizer = compile_kwargs.get("optimizer", None)
          if optimizer and isinstance(optimizer, AutoObject):
              optimizer = backend.instantiate(trial, optimizer)
              compile_kwargs["optimizer"] = optimizer
          model.compile(*compile_args, **compile_kwargs)
          return model
  
      return model_builder
  
imports: import copy
  import warnings
  from .objective import Objective
  from bigdl.nano.automl.hpo.backend import create_hpo_backend
  from bigdl.nano.automl.hpo.search import _search_summary, _end_search, _create_study, _validate_args, _strip_val_prefix, _prepare_args
  from bigdl.nano.automl.hpo.space import AutoObject
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.automl.utils.parallel import run_parallel
  import math
label_desc: Use image node_id 5 for calling the HPOMixin obj's underlying member method code with example usage: obj._get_model_builder(model_init_args_func, model_init_args_func_kwargs, modelcls, compile_args, compile_kwargs, backend) and returns: model_builder, model