tidy3d.plugins.autograd.invdes.FilterAndProject#

class FilterAndProject[source]#

Bases: Tidy3dBaseModel

A class that combines filtering and projection operations.

Parameters:
  • attrs (dict = {}) โ€“ Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

  • radius (Union[float, tuple[float, ...]]) โ€“ The radius of the kernel.

  • dl (Union[float, tuple[float, ...]]) โ€“ The grid spacing.

  • size_px (Union[int, tuple[int, ...]] = None) โ€“ The size of the kernel in pixels.

  • beta (NonNegativeFloat = 1.0) โ€“ The beta parameter for the tanh projection.

  • eta (NonNegativeFloat = 0.5) โ€“ The eta parameter for the tanh projection.

  • filter_type (Literal['circular', 'conic'] = conic) โ€“ The type of filter to create.

  • padding (Literal['constant', 'edge', 'reflect', 'symmetric', 'wrap'] = reflect) โ€“ The padding mode to use.

Attributes

Methods

Inherited Common Usage

radius#
dl#
size_px#
beta#
eta#
filter_type#
padding#
__call__(array, beta=None, eta=None)[source]#

Apply the filter and projection to an input array.

Parameters:
  • array (np.ndarray) โ€“ The input array to filter and project.

  • beta (float = None) โ€“ The beta parameter for the tanh projection. If None, uses the instanceโ€™s beta.

  • eta (float = None) โ€“ The eta parameter for the tanh projection. If None, uses the instanceโ€™s eta.

Returns:

The filtered and projected array.

Return type:

np.ndarray

__hash__()#

Hash method.