Skip to content
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

Redesigning Design Methods with Bayesian Optimisation #1762

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added convenience functions `from_terminal_positions` and `from_circular_path` to simplify setup of `VoltageIntegralAxisAligned` and `CustomCurrentIntegral2D`, respectively.
- Added `axial_ratio` to `DirectivityData.axial_ratio` for the `DirectivityMonitor`, defined as the ratio of the major axis to the minor axis of the polarization ellipse.
`ComponentModeler.batch_data` convenience property to access the `BatchData` corresponding to the component modeler run.
- Added optimization methods to the Design plugin. The plugin has been expanded to include Bayesian optimization, genetic algorithms and particle swarm optimization. Explanations of these methods are available in new and updated notebooks.
- Added new support functions for the Design plugin: automated batching of `Simulation` objects, and summary functions with `DesignSpace.estimate_cost` and `DesignSpace.summarize`.

### Changed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually could you add a change item just to let users know of any API changes they might need?

- Priority is given to `snapping_points` in `GridSpec` when close to structure boundaries, which reduces the chance of them being skipped.
- Gradients for autograd are computed server-side by default. They can be computed locally (requiring more data download) by passing `local_gradient=True` to the `web.run()` and related functions.
- Passing `path_dir` to `ComponentModeler` methods is deprecated in favor of setting `ComponentModeler.path_dir` and will result in an error if the two don't match.
- `BatchData` is now a mapping and can be accessed and iterated over like a Python dictionary (`.keys()`, `.values()`, `.items()`).
- `MethodRandom` and `MethodRandomCustom` have been removed from the Design plugin, and `DesignSpace.run_batch` has been superseded by `.run`.
- Design plugin has been significantly reworked to improve ease of use and allow for new optimization methods.

### Fixed
- Significant speedup for field projection computations.
Expand Down
Binary file added docs/_static/img/design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions docs/api/plugins/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ Design Space Exploration
:toctree: ../_autosummary/
:template: module.rst

tidy3d.plugins.design.Parameter
tidy3d.plugins.design.ParameterFloat
tidy3d.plugins.design.ParameterInt
tidy3d.plugins.design.ParameterAny
tidy3d.plugins.design.Method
tidy3d.plugins.design.MethodGrid
tidy3d.plugins.design.MethodMonteCarlo
tidy3d.plugins.design.MethodRandomCustom
tidy3d.plugins.design.MethodRandom
tidy3d.plugins.design.MethodBayOpt
tidy3d.plugins.design.MethodGenAlg
tidy3d.plugins.design.MethodParticleSwarm
tidy3d.plugins.design.DesignSpace
tidy3d.plugins.design.Results
tidy3d.plugins.design.Result
3,077 changes: 1,664 additions & 1,413 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ jax = { version = "0.4.25", extras = [
"cpu",
], source = "jaxsource", optional = true }

# design
bayesian-optimization = { version = "*", optional = true }
pygad = { version = "3.3.1", optional = true }
pyswarms = { version = "*", optional = true }

# scikit-rf
scikit-rf = { version = "*", optional = true }

Expand Down Expand Up @@ -104,13 +109,13 @@ signac = { version = "*", optional = true }
flax = { version = ">=0.8.2", optional = true }
sax = { version = "^0.11", optional = true }
vtk = { version = ">=9.2.6", optional = true }
pyswarms = { version = "*", optional = true }
sphinxemoji = { version = "*", optional = true }
devsim = { version = "*", optional = true }
cma = { version = "*", optional = true }

[tool.poetry.extras]
dev = [
'bayesian-optimization',
'bump-my-version',
"coverage",
'dill',
Expand All @@ -133,6 +138,7 @@ dev = [
'optax',
'pre-commit',
'pydata-sphinx-theme',
'pygad',
'pylint',
'pyswarms',
'pytest',
Expand Down
Loading
Loading