feature[notebooks]: add robust optimization of directional coupler with sharpness aware minimization optimizer #285
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.
In this notebook, we demonstrate how to design photonic components that remain robust against manufacturing variations—represented by perturbations in the optimizable design parameters—using the Sharpness‑Aware Minimization (SAM) optimizer.
Standard optimization methods often converge to parameter values that yield low loss but reside in "sharp" minima in the loss landscape; such solutions can be highly sensitive to small perturbations and may not perform well when fabricated. Inspired by the connection between the geometry of the loss landscape and generalization, SAM seeks parameter values that lie in "flat" regions, corresponding to neighborhoods with uniformly low loss. Originally developed to improve generalization in machine learning models, SAM achieves this by minimizing both the loss value and the loss sharpness simultaneously. This inherent robustness to perturbations makes SAM suited for designing photonic devices that are tolerant to manufacturing errors, such as geometry variations in lithography.
We will apply SAM to design a robust 50/50 directional coupler (DC), optimizing the boundaries of the coupling region defined using PolySlab structures within Tidy3D. This approach aims to produce a DC design whose performance is stable across a range of likely manufacturing variations in coupling region boundaries, drawing on the principles outlined by Foret, P., Kleiner, A., Mobahi, H. and Neyshabur, B., 2020. Sharpness-aware minimization for efficiently improving generalization. arXiv preprint arXiv:2010.01412.
Results:

We optimize for the split ratio using SAM and analyze the robustness of initial design and optimized design for geometric perturbations: