QctrlController
- class qctrlmloop.QctrlController(interface, qctrl, optimizer, test_point_count=None, learner=None, training_run_count=0, interleaved_run_count=0, **kwargs)
Controller for optimizations that uses Boulder Opal automated closed-loop optimizers.
You can use this controller to integrate an experiment managed by M-LOOP to a Boulder Opal automated closed-loop optimizer. Notice that you need to set up an M-LOOP Interface to your experiment, initiate a Boulder Opal session, and define your choice of Boulder Opal automated closed-loop optimizer prior to using this class.
- Parameters:
interface (mloop.interfaces.Interface) – The M-LOOP interface from where you obtain the cost value of the test points.
qctrl (qctrl.Qctrl) – The object representing the Boulder Opal session. You must initiate it before calling the controller.
optimizer (qctrl.types.closed_loop_optimization_step.Optimizer) – The Boulder Opal automated closed-loop optimizer that you want to use. It must be a valid optimizer object (containing either an initializer or a state from a previous optimization run), as described in the Boulder Opal reference documentation.
test_point_count (int, optional) – The requested number of test points that the Boulder Opal automated closed-loop optimizer generates at each step. If chosen, it must be greater than zero. This is a hint only. The Boulder Opal automated closed-loop optimizer might choose differently.
learner (mloop.learners.Learner, optional) – The M-LOOP Learner that this controller uses to obtain extra test points, before there are enough results to run a step of the Boulder Opal automated closed-loop optimizer. Defaults to None, in which case this controller uses a RandomLearner.
training_run_count (int, optional) – The minimum number of training points that the controller obtains before calling the Boulder Opal automated closed-loop optimizer. Defaults to 0, in which case the controller uses the minimum number of points that the Boulder Opal automated closed-loop optimizer requires.
interleaved_run_count (int, optional) – The minimum number of test points that the controller obtains from the learner between two calls of the Boulder Opal automated closed-loop optimizer, in addition to the points that Boulder Opal requested. Defaults to 0.
kwargs (dict) – All the extra arguments that the Controller class from M-LOOP accepts.
Methods
Check whether any of the end contions have been met.
Optimize the experiment.
Print results from optimization run to the logs
Save the archive associated with the controller class.