tidy3d.plugins.autograd.invdes.tanh_projection#
- class tanh_projection[source]#
Bases:
Apply a tanh-based soft-thresholding projection to an array.
This function performs a tanh projection on the input array, which is a common soft-thresholding scheme used in topology optimization. The projection modifies the values of the array based on the specified beta and eta parameters.
- Parameters:
array (NDArray) β The input array to be projected.
beta (float, optional) β The steepness of the projection. Higher values result in a sharper transition. Default is 1.0.
eta (float, optional) β The midpoint of the projection. Default is 0.5.
- Returns:
The array after applying the tanh projection.
- Return type:
NDArray
Inherited Common Usage