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

More autograd helpers #2055

Merged
merged 3 commits into from
Nov 5, 2024
Merged

More autograd helpers #2055

merged 3 commits into from
Nov 5, 2024

Conversation

yaugenst-flex
Copy link
Contributor

  • Removes DeprecationWarning of DataArray.values.
  • Adds smooth_min, smooth_max, and least_squares implementations to plugins.autograd.functions.
  • Adds @scalar_objective decorator that extracts DataArray.data and performs some additional checks on the output data of objective functions. If an objective function is decorated with this, calling DataArray.values within the objective function is not necessary anymore. Our grad and value_and_grad implementations in plugins.autograd wrap objective functions with this decorator automatically.
  • Some internal refactoring of the pad function.
  • Some test refactoring to reduce the no. of function calls for grad checks.

@yaugenst-flex yaugenst-flex self-assigned this Nov 4, 2024
Copy link
Collaborator

@tylerflex tylerflex left a comment

Choose a reason for hiding this comment

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

Looks great! think at some point we should include all of these in our demo notebooks. Just a few minor comments.

CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
tidy3d/components/data/data_array.py Show resolved Hide resolved
tidy3d/plugins/autograd/differential_operators.py Outdated Show resolved Hide resolved
tidy3d/plugins/autograd/functions.py Show resolved Hide resolved
tidy3d/plugins/autograd/utilities.py Show resolved Hide resolved
tidy3d/plugins/autograd/utilities.py Outdated Show resolved Hide resolved
tidy3d/plugins/autograd/utilities.py Outdated Show resolved Hide resolved
@momchil-flex momchil-flex added the 2.7 will go into version 2.7.* label Nov 5, 2024
@yaugenst-flex yaugenst-flex merged commit 6da4072 into develop Nov 5, 2024
15 checks passed
@yaugenst-flex yaugenst-flex deleted the autograd branch November 5, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.7 will go into version 2.7.*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants