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

Warning in NUTS sampler for _epsilon_bar #524

Open
1 of 3 tasks
nabriis opened this issue Sep 13, 2024 · 2 comments · May be fixed by #545
Open
1 of 3 tasks

Warning in NUTS sampler for _epsilon_bar #524

nabriis opened this issue Sep 13, 2024 · 2 comments · May be fixed by #545
Assignees
Labels
bug Something isn't working

Comments

@nabriis
Copy link
Collaborator

nabriis commented Sep 13, 2024

Description
The line of code, below, in NUTS is repeated twice and it generates a warning, we want to fix the line to get rid of the warning.

if self._epsilon_bar == "unset": # Initial value of epsilon_bar for sampling

The warning:

/Users/amal/Documents/research_code/CUQI-DTU/CUQIpy/cuqi/experimental/mcmc/_hmc.py:315: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
  if self._epsilon_bar == "unset": # Initial value of epsilon_bar for sampling

Example to reproduce

See FENIcs notebook in CUQI book.
https://github.com/CUQI-DTU/CUQI-Book/pull/74/files#diff-65b82e897cf4d25e53f93d35bcc5f582f2a6ebc08a631af478f5546e7e591fd5

Related online discussion of this warning
https://stackoverflow.com/questions/40659212/futurewarning-elementwise-comparison-failed-returning-scalar-but-in-the-futur

DoD

  • Fix to get rid of the warning is implemented
  • Fix is reviewed and merged
  • Issue created for CUQI-Book to rerun the notebooks that display this warning
@nabriis nabriis added the bug Something isn't working label Sep 13, 2024
@nabriis nabriis changed the title Bug in NUTS sampler Warning in NUTS sampler for _epsilon_bar Sep 13, 2024
@amal-ghamdi amal-ghamdi mentioned this issue Oct 1, 2024
2 tasks
@amal-ghamdi amal-ghamdi self-assigned this Oct 1, 2024
@amal-ghamdi amal-ghamdi linked a pull request Oct 6, 2024 that will close this issue
@amal-ghamdi
Copy link
Contributor

Can you please review the DoD @jakobsj? Thanks!

@jakobsj
Copy link
Contributor

jakobsj commented Oct 9, 2024

DoD approved @amal-ghamdi

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 a pull request may close this issue.

3 participants