Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80bac99

Browse files
committed
Restore reset to Bayes animation example.
Once the animation rolls around, it has iteration count < success count, which is nonsensical, and produces math domain errors.
1 parent 5f555f8 commit 80bac99

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

examples/animation/bayes_update.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ def __init__(self, ax, prob=0.5):
4141
def __call__(self, i):
4242
# This way the plot can continuously run and we just keep
4343
# watching new realizations of the process
44+
if i == 0:
45+
self.success = 0
46+
self.line.set_data([], [])
47+
return self.line,
4448

4549
# Choose success based on exceed a threshold with a uniform pick
4650
if np.random.rand(1,) < self.prob:

0 commit comments

Comments
 (0)