# CrossEntropyInitializer¶

class CrossEntropyInitializer(*, elite_fraction, bounds=None, rng_seed=None)

Configuration for the cross-entropy optimizer. The optimizer first fits a normal distribution to an elite_fraction of the given test points with the lowest cost function value. This normal distribution is then sampled to produce a new set of test points. Once all test points have converged, the optimization has converged and will no longer explore. Note that this optimizer requires at least $$\lceil 2 / \mathrm{elite}\_\mathrm{fraction} \rceil$$ results each step, to have at least 2 surviving elite points, and will throw an error if you don’t provide enough points for the initial step. If you don’t provide enough results for subsequent steps, the optimizer will not advance and will request more test points following the same distribution as in the previous step. For best results, sample the initial test points from parameter space, varying each axis with each point. This optimizer will reject optimizations where all test points in the initial step are identical. For more detail on the cross-entropy optimizer see cross-entropy method on Wikipedia.

Variables
• elite_fraction (float) – The top fraction of test points that the algorithm uses to generate the next distribution.

• bounds (List[qctrl.dynamic.types.closed_loop_optimization_step.BoxConstraint], optional) – The per-parameter bounds on the test points. These bounds must be in the same order as parameters in CostFunctionResult. The bounds are defined by imposing a box constraint on each individual parameter. By default these constraints are non-periodic, 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$$. If you choose these constraints to be periodic, points sampled outside the bounds are wrapped back into the bounds by considering the box contraints to infinitely tile the parameter space.

• rng_seed (int, optional) – Seed for the random number generator. Use this option to generate deterministic results from the optimizer.