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

Single-stage optimization example notebook #1236

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

IssraAli
Copy link
Collaborator

Created a single-stage optimization example notebook.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

github-actions bot commented Aug 30, 2024

|             benchmark_name             |         dt(%)          |         dt(s)          |        t_new(s)        |        t_old(s)        | 
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
 test_build_transform_fft_midres         |     +0.80 +/- 4.85     | +4.89e-03 +/- 2.97e-02 |  6.17e-01 +/- 2.6e-02  |  6.12e-01 +/- 1.4e-02  |
 test_build_transform_fft_highres        |     -0.09 +/- 1.83     | -8.93e-04 +/- 1.85e-02 |  1.01e+00 +/- 1.4e-02  |  1.01e+00 +/- 1.2e-02  |
 test_equilibrium_init_lowres            |     +0.83 +/- 1.57     | +3.20e-02 +/- 6.04e-02 |  3.88e+00 +/- 3.7e-02  |  3.85e+00 +/- 4.8e-02  |
 test_objective_compile_atf              |     +0.10 +/- 3.06     | +8.03e-03 +/- 2.41e-01 |  7.89e+00 +/- 1.9e-01  |  7.88e+00 +/- 1.4e-01  |
 test_objective_compute_atf              |     +1.05 +/- 3.12     | +1.11e-04 +/- 3.30e-04 |  1.07e-02 +/- 2.6e-04  |  1.06e-02 +/- 2.0e-04  |
 test_objective_jac_atf                  |     -2.75 +/- 2.93     | -5.37e-02 +/- 5.72e-02 |  1.90e+00 +/- 3.4e-02  |  1.95e+00 +/- 4.6e-02  |
 test_perturb_1                          |     +0.28 +/- 1.94     | +3.56e-02 +/- 2.48e-01 |  1.28e+01 +/- 2.3e-01  |  1.28e+01 +/- 9.1e-02  |
 test_proximal_jac_atf                   |     -0.88 +/- 1.15     | -7.04e-02 +/- 9.22e-02 |  7.92e+00 +/- 5.7e-02  |  7.99e+00 +/- 7.2e-02  |
 test_proximal_freeb_compute             |     +0.77 +/- 0.74     | +1.41e-03 +/- 1.35e-03 |  1.83e-01 +/- 8.7e-04  |  1.81e-01 +/- 1.0e-03  |
 test_build_transform_fft_lowres         |     +0.91 +/- 4.63     | +4.80e-03 +/- 2.43e-02 |  5.30e-01 +/- 2.1e-02  |  5.25e-01 +/- 1.2e-02  |
 test_equilibrium_init_medres            |     +1.53 +/- 1.47     | +6.33e-02 +/- 6.09e-02 |  4.20e+00 +/- 3.7e-02  |  4.14e+00 +/- 4.9e-02  |
 test_equilibrium_init_highres           |     +0.71 +/- 1.16     | +3.91e-02 +/- 6.33e-02 |  5.51e+00 +/- 4.3e-02  |  5.47e+00 +/- 4.6e-02  |
 test_objective_compile_dshape_current   |     +0.86 +/- 5.50     | +3.29e-02 +/- 2.12e-01 |  3.88e+00 +/- 4.4e-02  |  3.84e+00 +/- 2.1e-01  |
 test_objective_compute_dshape_current   |     +0.68 +/- 3.03     | +2.46e-05 +/- 1.09e-04 |  3.63e-03 +/- 9.9e-05  |  3.60e-03 +/- 4.6e-05  |
 test_objective_jac_dshape_current       |     +0.10 +/- 8.15     | +4.04e-05 +/- 3.38e-03 |  4.15e-02 +/- 2.2e-03  |  4.14e-02 +/- 2.6e-03  |
 test_perturb_2                          |     +0.41 +/- 1.27     | +7.30e-02 +/- 2.25e-01 |  1.77e+01 +/- 2.0e-01  |  1.76e+01 +/- 9.7e-02  |
 test_proximal_freeb_jac                 |     -0.27 +/- 1.06     | -2.02e-02 +/- 7.99e-02 |  7.50e+00 +/- 6.0e-02  |  7.52e+00 +/- 5.3e-02  |
 test_solve_fixed_iter                   |     +0.24 +/- 58.01    | +1.19e-02 +/- 2.84e+00 |  4.90e+00 +/- 2.0e+00  |  4.89e+00 +/- 2.0e+00  |

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.53%. Comparing base (831e7bd) to head (98f0fe0).
Report is 61 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1236   +/-   ##
=======================================
  Coverage   95.52%   95.53%           
=======================================
  Files          96       96           
  Lines       24010    24010           
=======================================
+ Hits        22936    22937    +1     
+ Misses       1074     1073    -1     

see 2 files with indirect coverage changes

@ddudt
Copy link
Collaborator

ddudt commented Aug 30, 2024

Noting that this will have to wait for #1222 and possibly also #1205

@dpanici
Copy link
Collaborator

dpanici commented Aug 30, 2024

Noting that this will have to wait for #1222 and possibly also #1205

IDT it needs to wait for #1205 if it is vacuum, though yea we should wait for both of these if we want a finite beta case also in this

@IssraAli
Copy link
Collaborator Author

IssraAli commented Aug 30, 2024

I wanted to mention, certain combinations of hyperparameters gave very bad outputs, see below for an example. I didn't really systematically document this, but I can do that if you guys are interested (sorry for the bad pic):

d4a6cf41-9f66-479b-a60f-9d74d820680a

The optimizer also converged to designs where the coils were all together in the centre of the torus all tangled up. Perhaps it would be worth it to create a constraint function that ensures that the coils are within a certain "winding volume" padding the torus to prevent these kinds of outputs.

I generally got much more normal looking coils with the coil-related losses weighted on the order of 100x higher than the QS loss. However, there seems to be quite a lot of field error.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants