tidy3d.plugins.adjoint.utils.filter.BinaryProjector#

class BinaryProjector[source]#

Bases: Filter

Projects a grayscale image towards min and max values using a smooth tanh function.

Parameters:
  • vmin (float) – Minimum value to project to.

  • vmax (float) – Maximum value to project to.

  • beta (float = 1.0) – Steepness of the binarization, higher means more sharp transition at the expense of gradient accuracy and ease of optimization. Can be useful to ramp up in a scheduled way during optimization.

  • eta (float = 0.5) – Halfway point in projection function.

  • strict_binarize (bool = False) – If False, the binarization is still continuous between min and max. If True, the values are snapped to the min and max values after projection.

Note

\[v(x) = v_{min} + (v_{max} - v_{min}) \frac{\mathrm{tanh}(\beta \eta) + \mathrm{tanh}(\beta (x - \eta))} {\mathrm{tanh}(\beta \eta) + \mathrm{tanh}(\beta (1 - \eta))}\]

Attributes

Methods

evaluate(spatial_data)

Process on supplied spatial data.

Inherited Common Usage

vmin#
vmax#
beta#
eta#
strict_binarize#
evaluate(spatial_data)[source]#

Process on supplied spatial data.

__hash__()#

Hash method.