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

Fix set of keys to aggregate results #883

Merged
merged 5 commits into from
Jul 7, 2022
Merged

Conversation

vwiela
Copy link
Contributor

@vwiela vwiela commented Jun 24, 2022

Calling an AmiciObjective with sensi-order=(1,) returns a dictionary with keys fval, radta, grad, but a pypesto.Objective will just return a dictionary with keys grad. So an aggregated objective build by a combination of both will fail if called with sensi-orders=(1,), if the Amici.Objective is the first partial objective. This also means the .get_grad function will fail and one cannot perfom optimization.
This can be fixed by taking the intersection of the keys of all results instead of just taking the keys of the first partial objective.

@vwiela vwiela requested a review from FFroehlich June 24, 2022 15:12
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2022

Codecov Report

Merging #883 (0d41557) into develop (1e30f36) will decrease coverage by 36.51%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           develop     #883       +/-   ##
============================================
- Coverage    88.33%   51.82%   -36.52%     
============================================
  Files          106      106               
  Lines         7580     7580               
============================================
- Hits          6696     3928     -2768     
- Misses         884     3652     +2768     
Impacted Files Coverage Δ
pypesto/objective/aggregated.py 73.21% <ø> (-26.79%) ⬇️
pypesto/objective/aesara.py 0.00% <0.00%> (-92.93%) ⬇️
pypesto/visualize/ensemble.py 10.16% <0.00%> (-89.84%) ⬇️
pypesto/sample/auto_correlation.py 9.09% <0.00%> (-86.37%) ⬇️
pypesto/visualize/optimizer_history.py 14.51% <0.00%> (-82.26%) ⬇️
pypesto/visualize/profiles.py 11.51% <0.00%> (-82.02%) ⬇️
pypesto/profile/profile_next_guess.py 11.57% <0.00%> (-81.82%) ⬇️
pypesto/visualize/profile_cis.py 19.44% <0.00%> (-80.56%) ⬇️
pypesto/sample/geweke_test.py 14.08% <0.00%> (-80.29%) ⬇️
pypesto/visualize/model_fit.py 0.00% <0.00%> (-80.00%) ⬇️
... and 55 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e30f36...0d41557. Read the comment docs.

pypesto/objective/aggregated.py Outdated Show resolved Hide resolved
Co-authored-by: Fabian Fröhlich <fabian_froehlich@hms.harvard.edu>
Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
@vwiela vwiela merged commit c9f752a into develop Jul 7, 2022
@FFroehlich FFroehlich deleted the fix_aggregate_results branch July 7, 2022 12:54
@PaulJonasJost PaulJonasJost mentioned this pull request Sep 8, 2022
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.

5 participants