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 1 commit 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_lowres         |     -5.45 +/- 3.81     | -2.95e-02 +/- 2.06e-02 |  5.12e-01 +/- 9.0e-03  |  5.42e-01 +/- 1.9e-02  |
 test_equilibrium_init_medres            |     -8.23 +/- 3.43     | -3.64e-01 +/- 1.51e-01 |  4.05e+00 +/- 1.0e-01  |  4.42e+00 +/- 1.1e-01  |
 test_equilibrium_init_highres           |     -0.51 +/- 6.06     | -2.85e-02 +/- 3.41e-01 |  5.59e+00 +/- 2.9e-01  |  5.62e+00 +/- 1.8e-01  |
 test_objective_compile_dshape_current   |     +1.85 +/- 3.28     | +7.11e-02 +/- 1.26e-01 |  3.92e+00 +/- 9.9e-02  |  3.85e+00 +/- 7.8e-02  |
 test_objective_compute_dshape_current   |     +4.84 +/- 3.36     | +1.68e-04 +/- 1.17e-04 |  3.64e-03 +/- 1.1e-04  |  3.47e-03 +/- 4.8e-05  |
 test_objective_jac_dshape_current       |     +0.45 +/- 4.95     | +1.75e-04 +/- 1.93e-03 |  3.92e-02 +/- 1.4e-03  |  3.91e-02 +/- 1.3e-03  |
 test_perturb_2                          |     +0.26 +/- 4.97     | +4.50e-02 +/- 8.64e-01 |  1.74e+01 +/- 5.8e-01  |  1.74e+01 +/- 6.4e-01  |
 test_proximal_freeb_jac                 |     -0.66 +/- 2.37     | -4.97e-02 +/- 1.78e-01 |  7.45e+00 +/- 6.9e-02  |  7.50e+00 +/- 1.6e-01  |
 test_solve_fixed_iter                   |     +1.50 +/- 59.20    | +7.06e-02 +/- 2.79e+00 |  4.78e+00 +/- 2.1e+00  |  4.71e+00 +/- 1.9e+00  |
 test_build_transform_fft_midres         |     -1.42 +/- 3.38     | -8.67e-03 +/- 2.06e-02 |  6.03e-01 +/- 1.6e-02  |  6.12e-01 +/- 1.3e-02  |
 test_build_transform_fft_highres        |     -1.75 +/- 4.02     | -1.77e-02 +/- 4.07e-02 |  9.96e-01 +/- 3.8e-02  |  1.01e+00 +/- 1.6e-02  |
 test_equilibrium_init_lowres            |     -2.00 +/- 5.11     | -7.76e-02 +/- 1.98e-01 |  3.81e+00 +/- 4.5e-02  |  3.89e+00 +/- 1.9e-01  |
 test_objective_compile_atf              |     -1.86 +/- 3.76     | -1.47e-01 +/- 2.98e-01 |  7.78e+00 +/- 2.5e-01  |  7.92e+00 +/- 1.7e-01  |
 test_objective_compute_atf              |     +0.31 +/- 3.36     | +3.13e-05 +/- 3.43e-04 |  1.03e-02 +/- 3.2e-04  |  1.02e-02 +/- 1.2e-04  |
 test_objective_jac_atf                  |     -0.78 +/- 4.02     | -1.49e-02 +/- 7.63e-02 |  1.88e+00 +/- 4.7e-02  |  1.90e+00 +/- 6.0e-02  |
 test_perturb_1                          |     -1.30 +/- 1.28     | -1.62e-01 +/- 1.59e-01 |  1.23e+01 +/- 6.8e-02  |  1.24e+01 +/- 1.4e-01  |
 test_proximal_jac_atf                   |     -0.49 +/- 0.78     | -3.88e-02 +/- 6.23e-02 |  7.93e+00 +/- 4.9e-02  |  7.97e+00 +/- 3.8e-02  |
 test_proximal_freeb_compute             |     +0.07 +/- 0.98     | +1.21e-04 +/- 1.77e-03 |  1.81e-01 +/- 1.4e-03  |  1.81e-01 +/- 1.1e-03  |

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.33%. Comparing base (2ebdf6a) to head (c4a09cd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1236   +/-   ##
=======================================
  Coverage   95.33%   95.33%           
=======================================
  Files          90       90           
  Lines       22702    22702           
=======================================
  Hits        21644    21644           
  Misses       1058     1058           

see 1 file 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