# GaussianProcessInitializer

class GaussianProcessInitializer(*, bounds, length_scale_bounds=None, seed=None, rng_seed=None)

Configuration for the Gaussian process based optimizer. The optimizer first trains a Gaussian process model with the data provided. Then, new test points, which minimize the cost and the uncertainty over the model, are generated and returned. The Gaussian process is defined by the kernel $$k({\mathbf x}_j, {\mathbf x}_k) = \exp \left(-\frac{1}{2} ( {\mathbf x}_j - {\mathbf x}_k )^\top \Sigma^{-2} ( {\mathbf x}_j - {\mathbf x}_k )\right)$$, where $${\mathbf x}_j$$ is an $$n$$-dimensional vector representing the $$j$$-th test point, $$\Sigma= {\rm diag}(l_1, \cdots, l_n)$$ is an $$n \times n$$ diagonal matrix, and $$\{ l_j \}$$ are the length scales. The length scales are tuned while training the model, within the bounds set by the length_scale_bounds attribute. Roughly speaking, the amount a parameter needs to change to impact the optimization cost should lie within the length scale bounds. Note that you must pass a non-empty list of results in the input to the initial step when using this initializer. It’s recommended to provide non-zero cost_uncertainty in CostFunctionResult when using this optimizer, otherwise you might encounter a numerical error when the optimizer tries to fit the kernel with your input data. If the error persists, try increasing the cost_uncertainty value or decreasing the minimum length scale bound. However, such numerical error is also an indication that your data might not be suitable to be modelled by a Gaussian process, and in that case, consider using a different closed-loop optimizer. For more detail on Gaussian processes see Gaussian process on Wikipedia.

Variables:
• bounds (List[qctrl.dynamic.types.closed_loop_optimization_step.BoxConstraint]) – The per-parameter bounds on the test points. The bounds are defined by imposing a box constraint on each individual parameter. That is, for each parameter $$x_j$$, the optimizer is only allowed to search the next test point subject to the constraint such that $$x^{\rm lower}_j \leq x_j \leq x^{\rm upper}_j$$. These constraints must be in the same order as parameters in CostFunctionResult.

• length_scale_bounds (List[qctrl.dynamic.types.closed_loop_optimization_step.BoxConstraint], optional) – The lower and upper bounds of the length scales $$\{ l_j \}$$ in the kernel. These bounds must be positive and set in the same order as parameters in CostFunctionResult. If not specified, they default to values derived from bounds by picking orders of magnitudes below/above the sidelength for each box axis.

• seed (int, optional) – Seed for the random number generator. If set, must be non-negative. Use this option to generate deterministic results from the optimizer.

• rng_seed (int, optional) – This parameter will be removed, please use seed instead.