-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing Adjoint Solver 2.0 #1167
Conversation
Check out this pull request on You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB. |
Comments:
|
Would be good to support passing a list of objective functions (all with the same arguments). Then you do one forward simulation to get all of the objective functions (at each frequency), but then do a separate adjoint simulation for each objective function. The reason to do this is to support arbitrary constrained optimization problems. For example, suppose we are maximizing power in mode 1 with a constraint that the power in mode 2 is ≤ 0.1 × (power in mode 1). (We could still support passing a single objective function as now, as a special case.) |
If you plot the gradient of an optimized structure, it should be positive where ε=12 and negative where ε=1 (or vice versa, depending on whether you are maximizing or minimizing), and nearly zero at points where ε takes on intermediate values. (This is just the KKT conditions.) |
I've made the requested changes but discovered an annoying bug with my interpolator. It seems that if I have far more design parameters than meep pixels in the design region, the gradient doesn't match up with its finite difference approximate. You can view this effect in this notebook. Interestingly I can still optimize fairly well (as demonstrated in the filtering example). |
Tutorials are fixed. Filtered Waveguide Bend designs a fully binarized, broadband bend with a minimum length scale constraint: with a decent response: I'd say it's ready for merging. I can pull docs and "official" tests together in another PR. |
Hi, I tried to run the introduction script but got this error: AttributeError: module 'meep.adjoint' has no attribute 'BilinearInterpolationBasis' I updated my meep using the simpetus nightly build before trying. Has the adjoint solver 2.0 been included in it? |
No, it was just merged, so it will take 24 hours or so to appear in the nightly builds. |
* init * fix notebooks * Forgot Makefile.am * more notebooks and updated requested changes * bug fixes * tutorials Co-authored-by: Alec Hammond <[email protected]>
This is an initial stab at the new and improved adjoint solver. This update is meant to enable an adjoint solver that is simple, flexible, and accurate.
Major differences and features from previous version:
autograd
The quickest and easiest way to get up to speed with the new features is to review the accompanying notebooks:
I'm sure several changes will have to be made before merging. Some of those include:
design_variables = [...]
instead ofbasis = [...]
.