Skip to content

Commit

Permalink
fix assertions of pc.mini_batch_em
Browse files Browse the repository at this point in the history
  • Loading branch information
liuanji authored Aug 13, 2024
1 parent 043e9e3 commit c13d114
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyjuice/model/tensorcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def mini_batch_em(self, step_size: float, pseudocount: float = 0.0, keep_zero_pa
:param step_size_rescaling: whether to rescale the step size by flows
:type step_size_rescaling: bool
"""
assert self._cum_flow > 0.0, "Please perform a backward pass before calling `mini_batch_em`."
assert not step_size_rescaling or self._cum_flow > 0.0, "Please perform a backward pass before calling `mini_batch_em`."
assert 0.0 < step_size <= 1.0, "`step_size` should be between 0 and 1."

# Apply step size rescaling according to the mini-batch EM objective derivation
Expand Down

0 comments on commit c13d114

Please sign in to comment.