compute_gradient_from_fields#
- Parametrization.compute_gradient_from_fields(gradient_fields: ndarray, fdtd_session: FdtdSession, params: ndarray, polygon_name: str | None = None) ndarray#
Compute the gradient for a Parametrization.
- Parameters:
- gradient_fields
np.ndarray Adjoint gradient fields with shape
(nx, ny, nz, 3), already summed over wavelengths.- fdtd_session
FdtdSession Active FDTD session used to compute finite-difference Jacobians.
- params
np.ndarray Current optimization parameter values.
- polygon_name
str,optional Ignored. Accepted to match the
BaseParametrizationAPI soCombinedParametrizationcan pass per-child overrides uniformly.Parametrizationdoes not back a single polygon object, so the override has no effect here.
- gradient_fields
- Returns:
np.ndarray1D gradient array with length equal to the number of optimization parameters.