refactor(notebooks): use internal adam for autograd25#520
Merged
Conversation
Contributor
|
Spell check passed successfully for 1 notebook(s). |
groberts-flex
approved these changes
Jun 18, 2026
groberts-flex
left a comment
Contributor
There was a problem hiding this comment.
thank you @marcorudolphflex
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.
Summary
This extracts the
Autograd25WaveguideCrossing.ipynbchanges from #465 into a standalone PR.optaxoptimizer setup and manual update loop with Tidy3D's internaladamandoptimizehelpers.optaxdependency.f0 / 20tof0 / 5, matching the refactor(notebooks): use internal adam and optimize helper - batch 4 #465 note that this avoided glitchy transmission values above 1.Autograd25 Result From #465
Objective (max.): develop
9.6852e-01vs. branch9.4947e-01(-1.97%).develop:
branch:
Validation
uvx ruff format --check --diff Autograd25WaveguideCrossing.ipynbuvx ruff check Autograd25WaveguideCrossing.ipynbuv run --no-project python scripts/sync_metadata_tags.py --checkuv run --no-project python scripts/validate_notebook_metadata.py Autograd25WaveguideCrossing.ipynbuv run --no-project python scripts/check_notebook_private_paths.py Autograd25WaveguideCrossing.ipynbpython3 misc/check_misc_references.pyuv run spellcheck.py Autograd25WaveguideCrossing.ipynbNote
Low Risk
Documentation-only example refactor with no library or auth changes; the wider source bandwidth only affects this notebook’s simulation numerics.
Overview
Autograd25WaveguideCrossing.ipynbnow follows the same autograd optimization pattern as other inverse-design examples: importsadamandoptimizefromtidy3d.plugins.autograd, builds anadam(learning_rate=...)optimizer, and runs the loop viaoptimize(...)with bounds, maximize direction, and a step callback instead of a hand-rolledoptaxupdate loop. The notebook no longer depends onoptax.The horizontal mode source
GaussianPulsebandwidth is widened fromfwidth=freq0 / 20tofreq0 / 5to avoid unphysical transmission above 1; related markdown describes theoptimizehelper rather than manual optimizer state management.Reviewed by Cursor Bugbot for commit f8cb9ba. Bugbot is set up for automated code reviews on this repo. Configure here.