Strategy

Parallel Strategies

Register objectives for incomplete trials

class orion.core.worker.strategy.BaseParallelStrategy(*args, **kwargs)[source]

Strategy to give intermediate results for incomplete trials

Attributes
configuration

Provide the configuration of the strategy as a dictionary.

Methods

lie(trial)

Construct a fake result for an incomplete trial

observe(points, results)

Observe completed trials

property configuration

Provide the configuration of the strategy as a dictionary.

lie(trial)[source]

Construct a fake result for an incomplete trial

Parameters
trial: `orion.core.worker.trial.Trial`

A trial object which is not supposed to be completed.

Returns
orion.core.worker.trial.Trial.Result

The fake objective result corresponding to the trial given.

Notes

If the trial has an objective even if not completed, a warning is printed to user with a pointer to documentation to resolve the database corruption. The result returned is the corresponding objective instead of the lie.

abstract observe(points, results)[source]

Observe completed trials

Parameters
points: list of tuples of array-likes

Points from a orion.algo.space.Space. Evaluated problem parameters by a consumer.

results: list of dict

Contains the result of an evaluation; partial information about the black-box function at each point in params.

class orion.core.worker.strategy.MaxParallelStrategy(default_result=inf)[source]

Parallel strategy that uses the max of completed objectives

Attributes
configuration

Provide the configuration of the strategy as a dictionary.

Methods

lie(trial)

See BaseParallelStrategy.lie

observe(points, results)

See BaseParallelStrategy.observe

property configuration

Provide the configuration of the strategy as a dictionary.

lie(trial)[source]

See BaseParallelStrategy.lie

observe(points, results)[source]

See BaseParallelStrategy.observe

class orion.core.worker.strategy.MeanParallelStrategy(default_result=inf)[source]

Parallel strategy that uses the mean of completed objectives

Attributes
configuration

Provide the configuration of the strategy as a dictionary.

Methods

lie(trial)

See BaseParallelStrategy.lie

observe(points, results)

See BaseParallelStrategy.observe

property configuration

Provide the configuration of the strategy as a dictionary.

lie(trial)[source]

See BaseParallelStrategy.lie

observe(points, results)[source]

See BaseParallelStrategy.observe

class orion.core.worker.strategy.NoParallelStrategy(*args, **kwargs)[source]

No parallel strategy

Methods

lie(trial)

See BaseParallelStrategy.lie

observe(points, results)

See BaseParallelStrategy.observe

lie(trial)[source]

See BaseParallelStrategy.lie

observe(points, results)[source]

See BaseParallelStrategy.observe

class orion.core.worker.strategy.Strategy(of_type, *args, **kwargs)[source]

Class used to build a parallel strategy given name and params

See also

orion.core.utils.Factory metaclass and BaseParallelStrategy interface.

class orion.core.worker.strategy.StubParallelStrategy(stub_value=None)[source]

Parallel strategy that returns static objective value for incompleted trials.

Attributes
configuration

Provide the configuration of the strategy as a dictionary.

Methods

lie(trial)

See BaseParallelStrategy.lie

observe(points, results)

See BaseParallelStrategy.observe

property configuration

Provide the configuration of the strategy as a dictionary.

lie(trial)[source]

See BaseParallelStrategy.lie

observe(points, results)[source]

See BaseParallelStrategy.observe

orion.core.worker.strategy.get_objective(trial)[source]

Get the value for the objective, if it exists, for this trial

Returns

Float or None The value of the objective, or None if it doesn’t exist