refactor(notebooks): use internal adam and optimize helper - batch 4#465
Closed
marcorudolphflex wants to merge 5 commits into
Closed
refactor(notebooks): use internal adam and optimize helper - batch 4#465marcorudolphflex wants to merge 5 commits into
marcorudolphflex wants to merge 5 commits into
Conversation
Contributor
|
Spell check passed successfully for 12 notebook(s). |
5692255 to
a76d195
Compare
Contributor
Author
|
will rerun Autograd27 with other seed to check if we can still see that objective setback. |
a76d195 to
4985eb2
Compare
a0742b4 to
e717c70
Compare
Contributor
Author
|
Superseded by #513, which keeps only the no-brainer subset and leaves Metalens, Autograd27Smatrix, and Autograd25WaveguideCrossing out for separate discussion. |
This was referenced Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
follow-up from #463
Replaces the optax Adam with our Adam and makes use of the
optimizehelper where easily possible. This is the fourth batch, covering the 12 notebooks currently in this PR wheredevelopstill had real optax usage.Results are roughly unchanged overall. Notable differences are sorted by risk first; images can be inserted/updated inline as needed.
Percent differences below use
(branch - develop) / develop. For max objectives, positive is better; for min objectives/costs, negative is better.1.0909e-023.6146e-02+2.5237e-02+231.34%3.0199e-015.1519e-01+2.1320e-01+70.60%6.9960e+011.2850e+02+5.854e+01+83.68%4.799e-014.801e-01+2.0e-04+0.04%-1.98 dBvs. branch-1.99 dB2.2378e+012.3344e+01+9.660e-01+4.32%9.6852e-019.4947e-01-1.905e-02-1.97%fwidthfromf0 / 20tof0 / 58.792e-018.790e-01-2.0e-04-0.02%+0.02%; final efficiency0.91to0.894.0488e-024.0460e-02-2.8e-05-0.07%8.134e-018.139e-01+5.0e-04+0.06%20.81231520.717626-9.4689e-02-0.45%1.194e-011.185e-01-9.0e-04-0.75%0.099308317757073240.0993083177570732400.00%Objective (min.): develop
1.0909e-02vs. branch3.6146e-02(+231.34%)develop

branch

❓ TidyFab0GC.ipynb
Objective (max.): develop
3.0199e-01vs. branch5.1519e-01(+70.60%)Unexpectedly better. This may be from client/solver changes rather than the optimizer refactor.
❓ Metalens.ipynb
Objective (max., saved notebook output): develop
6.9960e+01vs. branch1.2850e+02(+83.68%)Branch output is internally consistent with the current source and the rerun (
120.32to128.50,30optimization steps). The large shift is not expected from the optimizer refactor; the old develop output cells did not match the current code path with bothsource_xandsource_y. I checked with Filipe that this is okay to keep, and the changed results are explainable from that stale-output/code mismatch.Autograd19ApodizedCoupler.ipynb
Objective (max.): develop
4.799e-01vs. branch4.801e-01(+0.04%)Maximum coupling efficiency: develop
-1.98 dBvs. branch-1.99 dBRerun is back in line with develop.
Autograd7Metalens.ipynb
Objective (max.): develop
2.2378e+01vs. branch2.3344e+01(+4.32%)Plot/result roughly unchanged.
Autograd25WaveguideCrossing.ipynb: had to change
fwidthfromf0 / 20tof0 / 5; otherwise the transmission output got glitchy values above 1.Objective (max.): develop
9.6852e-01vs. branch9.4947e-01(-1.97%)develop:

branch:

Autograd26DiffractiveBeamSplitter.ipynb
develop:
branch:
Later final-efficiency output: develop
0.91vs. branch0.89.Autograd28FiberLens.ipynb
Objective / final flux (max.): develop
4.0488e-02vs. branch4.0460e-02(-0.07%)Plot/result nearly unchanged.
BilayerSiNSiGC.ipynb
Objective (max.): develop
8.134e-01vs. branch8.139e-01(+0.06%)Effectively unchanged.
RFAutograd1RectangularPatchAntenna.ipynb
Final nonzero FOM: develop
20.812315vs. branch20.717626(-0.45%).Optimization a little less smooth now, result differs a bit:
Autograd13Metasurface.ipynb
Final loss (min.): develop
1.194e-01vs. branch1.185e-01(-0.75%).Autograd23FabricationAwareInvdes.ipynb
Did not rerun this notebook because I do not have credits for the prefab/fabrication-aware run path. No result shift is expected from this diff.