tidy3d.plugins.design.MethodMonteCarlo#
- class MethodMonteCarlo[source]#
Bases:
AbstractMethodRandomSelect sampling points using Monte Carlo sampling. The sampling is done with the Latin Hypercube method from scipy.
- Parameters:
name (Optional[str] = None) – Optional name for the sweep method.
filter_func (Optional[Callable[..., bool]] = None) – Optional callback called as
filter_func(**sample)for each sampled parameter combination. ReturnTrueto keep the sample orFalseto skip it.num_points (PositiveInt) – The number of points to be generated for sampling.
seed (Optional[PositiveInt] = None) – Sets the seed used by the optimizers to set constant random number generation.
filter_attempts_per_sample (PositiveInt = 32) – Maximum number of random sampling attempts per requested sample when
filter_funcis provided. The overall attempt limit isnum_points * filter_attempts_per_sample.
Example
>>> import tidy3d.plugins.design as tdd >>> method = tdd.MethodMonteCarlo(num_points=20)
Attributes
num_pointsseedfilter_attempts_per_samplefilter_funcname