Do autograd gradients not flow through FieldProjectionCartesianMonitor? #2595
Unanswered
samuelkim16
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to do adjoint optimization of a structure, somewhat drawing from the tutorials on Inverse design of a metalens and Modeling a metalens (specifically the section on field projection to a focal plane). Because the point of optimization is far away from the structure, I would like to use
FieldProjectionCartesianMonitor
to project the near fields to a position far away from the structure. However, I am calculating the gradient norm (np.linalg.norm(gradient)
) to be 0, and I get the warning:If I replace the monitor with a normal field monitor, then I get gradients again, so I believe the simulation is set up correctly.
The other possibility is that I am accidentally cutting off the gradients in the objective function, which looks something like this:
Beta Was this translation helpful? Give feedback.
All reactions