Skip to content

Added test for gradient flow and verifying that the deviation from th… #92

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

Merged
merged 4 commits into from
Apr 29, 2022

Conversation

torbjornstoro
Copy link
Collaborator

…e original fdtd is not significant

Description

As title

Resolved Issues

How Has This Been Tested?

pytest

@torbjornstoro torbjornstoro requested a review from gomezzz April 28, 2022 11:11
Copy link
Collaborator

@gomezzz gomezzz left a comment

Choose a reason for hiding this comment

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

minimal changes

grid.run(cfg.FDTD_niter)
t_signal_material, r_ = _get_detector_values(t_detector_material, _)
# Original fdtd
import fdtd
Copy link
Collaborator

Choose a reason for hiding this comment

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

wouldn't it be easier to just hard-coded save the output values from the original FDTD? If the FDTD module changes in the future otherwise we may get an error here 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

(still do keep the code to reproduce the code to create the ground truth in a comment in here ideally so we can easily update values if ever necessary)

Copy link
Collaborator Author

@torbjornstoro torbjornstoro Apr 29, 2022

Choose a reason for hiding this comment

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

Where should I put the code for the generation? The code is the same as in the generate ground-truth data notebook

@torbjornstoro torbjornstoro requested a review from gomezzz April 29, 2022 14:37
Copy link
Collaborator

@gomezzz gomezzz left a comment

Choose a reason for hiding this comment

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

minimal change

# Add only the z component of the E field from the center point of the detector, as there is only z polarized waves
raw_signal.append(t_detector_material.detector_values()["E"][i][1][2])
t.append(i)
original_fdtd = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

@torbjornstoro torbjornstoro merged commit 730ad9d into main Apr 29, 2022
@torbjornstoro torbjornstoro deleted the WI_add_tests branch April 29, 2022 15:54
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.

Add unit test to verify the difference from the original fdtd is not too big test for gradient flow
2 participants