poli.objective_factory.create

poli.objective_factory.create#

poli.objective_factory.create(name: str, *, seed: Optional[int] = None, observer_init_info: Optional[dict] = None, observer_name: Optional[str] = None, force_isolation: bool = False, batch_size: Optional[int] = None, parallelize: bool = False, num_workers: Optional[int] = None, evaluation_budget: int = inf, quiet: bool = False, **kwargs_for_factory) Problem#

Instantiantes a black-box function by calling the create method of the associated factory.

Parameters
  • name (str) – The name of the objective function.

  • seed (int, optional) – The seed value for random number generation.

  • observer_init_info (dict, optional) – Optional information about the caller that is forwarded to the logger to initialize the run.

  • observer_name (str, optional) – The observer to use.

  • force_isolation (bool, optional) – If True, then the objective function is instantiated as an isolated process.

  • batch_size (int, optional) – The batch size, passed to the black box to run evaluations on batches. If None, it will evaluate all inputs at once.

  • parallelize (bool, optional) – If True, then the objective function runs in parallel.

  • num_workers (int, optional) – When parallelize is True, this specifies the number of processes to use. By default, it uses half the number of available CPUs (rounded down).

  • evaluation_budget (int, optional) – The maximum number of evaluations allowed. By default, it is infinity.

  • quiet (bool, optional) – If True, we squelch the messages giving feedback about the creation process. By default, it is False.

  • **kwargs_for_factory (dict, optional) – Additional keyword arguments for the factory.

Returns

problem – The black-box function, initial value, and related information.

Return type

AbstractProblem