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 (np.ndarray) β The input array to be projected.
beta (float = BETA_DEFAULT) β The steepness of the projection. Higher values result in a sharper transition.
eta (float = ETA_DEFAULT) β The midpoint of the projection.
- Returns:
The array after applying the tanh projection.
- Return type:
np.ndarray
Inherited Common Usage