Primary algorithm¶
TODO
orion.core.worker.primary_algo
– Sanitizing wrapper of main algorithm¶
-
class
orion.core.worker.primary_algo.
PrimaryAlgo
(space, algorithm_config)[source]¶ Perform checks on points and transformations. Wrap the primary algorithm.
1. Checks requirements on the parameter space from algorithms and create the appropriate transformations. Apply transformations before and after methods of the primary algorithm. 2. Checks whether incoming and outcoming points are compliant with a space.
Attributes: configuration
Return tunable elements of this algorithm in a dictionary form appropriate for saving.
is_done
Return True, if an algorithm holds that there can be no further improvement.
should_suspend
Allow algorithm to decide whether a particular running trial is still worth to complete its evaluation, based on information provided by the
judge
method.space
Domain of problem associated with this algorithm’s instance.
state_dict
Return a state dict that can be used to reset the state of the algorithm.
Methods
judge
(point, measurements)Inform an algorithm about online measurements of a running trial. observe
(points, results)Observe evaluation results corresponding to list of points in space. score
(point)Allow algorithm to evaluate point based on a prediction about this parameter set’s performance. seed_rng
(seed)Seed the state of the algorithm’s random number generator. set_state
(state_dict)Reset the state of the algorithm based on the given state_dict suggest
([num])Suggest a num of new sets of parameters. -
configuration
¶ Return tunable elements of this algorithm in a dictionary form appropriate for saving.
-
is_done
¶ Return True, if an algorithm holds that there can be no further improvement.
-
judge
(point, measurements)[source]¶ Inform an algorithm about online measurements of a running trial.
The algorithm can return a dictionary of data which will be provided as a response to the running environment. Default is None response.
-
observe
(points, results)[source]¶ Observe evaluation results corresponding to list of points in space.
-
score
(point)[source]¶ Allow algorithm to evaluate point based on a prediction about this parameter set’s performance. Return a subjective measure of expected performance.
By default, return the same score any parameter (no preference).
-
set_state
(state_dict)[source]¶ Reset the state of the algorithm based on the given state_dict
Parameters: state_dict – Dictionary representing state of an algorithm
-
should_suspend
¶ Allow algorithm to decide whether a particular running trial is still worth to complete its evaluation, based on information provided by the
judge
method.
-
space
¶ Domain of problem associated with this algorithm’s instance.
Note
Redefining property here without setter, denies base class’ setter.
-
state_dict
¶ Return a state dict that can be used to reset the state of the algorithm.
-
suggest
(num=1)[source]¶ Suggest a num of new sets of parameters.
Parameters: num – how many sets to be suggested. Note
New parameters must be compliant with the problem’s domain
orion.algo.space.Space
.