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

size=0 adjoint montiors for single pixel dims in custom mediums #2052

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

tylerflex
Copy link
Collaborator

An optimization to reduce data usage for CustomMedium adjoint monitors. size=0 for any dims with just 1 pixel, since we only evaluate at centers.

Note; eventually would be realy nice to just have a point-cloud monitor and do these custom for each structure

@momchil-flex
Copy link
Collaborator

So this is probably nice to get in right now but in general these two things should not be coupled? Like I should be able to define my custom medium by a single pixel if I want it extruded in a given dimension, but potentially still integrate fields across that dimension which would be important e.g. for polarization mixing components?

@tylerflex
Copy link
Collaborator Author

Not sure I see the problem with this?

Until we add the option to do full volume integration, I think it makes sense to just restrict the monitor size, like we do with PolySlab.

Agree that the point cloud monitor is kind of a separate issue. In principle all 3 are separate?

@momchil-flex
Copy link
Collaborator

Yeah, we can merge this in right away, I was just thinking that we need to make sure this is removed when we incorporate full volume integration.

Have you done any tests that the gradients have not changed? I am not sure if this would be captured by our automatic testing.

@tylerflex
Copy link
Collaborator Author

I tested with a couple different notebooks (mode converter and WDM) both looked the same as before, but were a bit faster

@momchil-flex momchil-flex merged commit 8e70dfe into develop Nov 4, 2024
15 checks passed
@momchil-flex momchil-flex deleted the tyler/autograd_/custom_medium_grad_mnt branch November 4, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants