tidy3d.plugins.autograd.invdes.LengthScaleConstraint#
- class LengthScaleConstraint[source]#
Bases:
Tidy3dBaseModelGeometric minimum length-scale constraints for a conic-filtered, projected density.
- Parameters:
min_length_scale (PositiveFloat) – Target minimum width of solid and void features, in the units of the filter’s ‘dl’, or in pixels when it has none.
tolerance (PositiveFloat = 1e-08) – Constraint tolerance epsilon used by the normalized form.
normalized (bool = False) – Return ‘g / tolerance - 1’, which is satisfied when non-positive, instead of the raw ‘g’.
of (Implements the solid and void constraints of Zhou et al. 1 with the settings)
:param Arrieta et al. [2]. With filtered field \(\tilde\rho\): :param projected field: :param \(\hat\rho\) and filter radius \(R\): :param .. math::: g_s = operatorname{mean}left[hatrho, e^{-c |nablatilderho|^2}
min(tilderho - eta_e, 0)^2right], quad g_v = operatorname{mean}left[(1 - hatrho), e^{-c |nablatilderho|^2} min(eta_d - tilderho, 0)^2right],
:param with \(c = 64 R^2\) and \(\eta_d = 1 - \eta_e\). The constraint takes the result: :param of
FilterAndProject.evaluate(): :param so it measures the fields of the design being: :param simulated: :param with the filter: :param projection: :parambetaandetathat produced it. The filter: :param must be conic and the effectiveeta0.5.: :param .. code-block:: python: project = FilterAndProject(radius=0.1, dl=0.02, beta=np.inf, projection=”ssp2”)width = LengthScaleConstraint(min_length_scale=0.1)
result = project.evaluate(params) density = result.design g_s, g_v = width(result)
- Parameters:
conic (The thresholds differ from the published ones. Those assume a 1D hat kernel; the)
cone (filter here is a 2D radial)
:param and \(\eta_e\) is derived for it with the same: :param construction (for \(\ell = R\): :param 0.78 instead of 0.75). \(R\) is the radius the: :param sampled kernel actually has: :param
ceil(radius / dl) * dlor(size_px - 1) / 2pixels.: :param Arrieta et al. recommendradius = min_length_scale; the thresholds require: :parammin_length_scale <= 1.5 * R: :param the range Arrieta et al. validate: :param and a kernel radius of at: :param least 3 pixels.: :param Switch the constraints on in the final \(\beta = \infty\) stage. Without a: :param constrained optimizer: :param add them to the objective as penalty terms.: :param .. warning::: Experimental: the API and defaults may change in a future release.Notes
Attributes
- min_length_scale#
- tolerance#
- normalized#