tidy3d.plugins.design.MethodBayOpt#

class MethodBayOpt[source]#

Bases: MethodOptimize, ABC

A standard method for performing a Bayesian optimization search, built around the Bayesian Optimization package. The fitness function is maximising by default.

Parameters:
  • attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

  • name (Optional[str] = None) – Optional name for the sweep method.

  • seed (Optional[PositiveInt] = None) – Set the seed used by the optimizers to ensure consistant random number generation.

  • initial_iter (PositiveInt) – The number of search runs to be done initialially with parameter values picked randomly. This provides a starting point for the Gaussian processor to optimize from. These solutions can be computed as a single Batch if the pre function generates Simulation objects.

  • n_iter (PositiveInt) – Following the initial search, this is number of iterations the Gaussian processor should be sequentially called to suggest parameter values and register the results.

  • acq_func (Literal['ucb', 'ei', 'poi'] = ucb) – The type of acquisition function that should be used to suggest parameter values. More detail available in the package docs.

  • kappa (PositiveFloat = 2.5) –

    The kappa coefficient used by the ucb acquisition function. More detail available in the package docs.

  • xi (NonNegativeFloat = 0.0) –

    The Xi coefficient used by the ei and poi acquisition functions. More detail available in the package docs.

Example

>>> import tidy3d.plugins.design as tdd
>>> method = tdd.MethodBayOpt(initial_iter=4, n_iter=10)

Attributes

Methods

Inherited Common Usage

initial_iter#
n_iter#
acq_func#
kappa#
xi#
__hash__()#

Hash method.