Skip to content

Commit

Permalink
Merge pull request #511 from lukego/mh-tidyup
Browse files Browse the repository at this point in the history
Remove minor redundancy in metropolis_hastings
  • Loading branch information
ztangent authored Oct 11, 2023
2 parents 6e87ca1 + 67df3ed commit 0570918
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/inference/mh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ Perform a Metropolis-Hastings update that proposes new values for the selected a
function metropolis_hastings(
trace, selection::Selection;
check=false, observations=EmptyChoiceMap())
args = get_args(trace)
argdiffs = map((_) -> NoChange(), args)
(new_trace, weight) = regenerate(trace, args, argdiffs, selection)
(new_trace, weight) = regenerate(trace, selection)
check && check_observations(get_choices(new_trace), observations)
if log(rand()) < weight
# accept
Expand Down

0 comments on commit 0570918

Please sign in to comment.