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. IfTrue
, 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.
- vmin#
- vmax#
- beta#
- eta#
- strict_binarize#
- __hash__()#
Hash method.