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

Calling prior in sampling with fixed parameters does not work #1378

Merged
merged 9 commits into from
May 16, 2024

Conversation

arrjon
Copy link
Contributor

@arrjon arrjon commented Apr 24, 2024

The NegLogParameterPriors objective does not properly account for fixed parameters when invoked during sampling. When it's integrated into the AggregatedObjective, optimization functions correctly; however, issues arise during sampling because call_unprocessed is triggered with the reduced parameter vector, causing a failure.

Maybe there is a better way to fix this, as I just updated the call of neglogprior, but I feel this might break stuff during optimzation.

@arrjon arrjon added the bug Something isn't working label Apr 24, 2024
@arrjon arrjon self-assigned this Apr 24, 2024
@arrjon arrjon requested review from dilpath and vwiela as code owners April 24, 2024 15:55
@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.52%. Comparing base (049493c) to head (e555ef2).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1378      +/-   ##
===========================================
+ Coverage    84.48%   84.52%   +0.03%     
===========================================
  Files          157      157              
  Lines        12958    12956       -2     
===========================================
+ Hits         10948    10951       +3     
+ Misses        2010     2005       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arrjon
Copy link
Contributor Author

arrjon commented Apr 24, 2024

I reverted the inital fix since I found a better solution. If you now call problem.x_priors it behaves exactly as problem.objective, which is the behaviour I would expect (wrt fixed parameters etc.).

Copy link
Member

@dilpath dilpath left a comment

Choose a reason for hiding this comment

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

Fine for me for now 👍

I imagine this will be obsolete if #1325 is resolved by implementing objective type flags.

Copy link
Contributor

@vwiela vwiela left a comment

Choose a reason for hiding this comment

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

Thanks for spotting.

Think this is a good fix to it.

@arrjon
Copy link
Contributor Author

arrjon commented Apr 25, 2024

After discussion, @PaulJonasJost and I removed the deepcopy of the NegLogParameterPriors class. Otherwise, copying the prior does not work. This happens in the parallel tempering sampler, when the prior is copied to the different chains.

Copy link
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@arrjon arrjon merged commit d5fde03 into develop May 16, 2024
18 checks passed
@arrjon arrjon deleted the sampling_fixed branch May 16, 2024 07:36
This was referenced May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants