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 anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.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 generatesSimulation
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
andpoi
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.