some docs

release/4.3a0
Varun Agrawal 2025-05-15 22:59:26 -04:00
parent faedfcb182
commit d01bf5d80b
2 changed files with 3 additions and 1 deletions

View File

@ -49,6 +49,7 @@ class TestDiscreteConditional(GtsamTestCase):
# Sample with only 1 variable # Sample with only 1 variable
conditional = DiscreteConditional(self.key, "7/3") conditional = DiscreteConditional(self.key, "7/3")
# Sample multiple times and average to get mean
p = 0 p = 0
for _ in range(niters): for _ in range(niters):
p += conditional.sample(rng) p += conditional.sample(rng)
@ -57,6 +58,7 @@ class TestDiscreteConditional(GtsamTestCase):
# Sample with variable and parent # Sample with variable and parent
conditional = DiscreteConditional(self.key, self.parents, "7/3 2/8") conditional = DiscreteConditional(self.key, self.parents, "7/3 2/8")
# Sample multiple times and average to get mean
p = 0 p = 0
parentValues = gtsam.DiscreteValues() parentValues = gtsam.DiscreteValues()
parentValues[self.parent[0]] = 1 parentValues[self.parent[0]] = 1

View File

@ -71,7 +71,7 @@ class TestGaussianBayesNet(GtsamTestCase):
# Sample with rng # Sample with rng
rng = gtsam.MT19937(42) rng = gtsam.MT19937(42)
conditional = GaussianConditional(_x_, [9.0], I_1x1) conditional = GaussianConditional(_x_, [9.0], I_1x1)
# Sample multiple times and average to gey mean # Sample multiple times and average to get mean
val = 0 val = 0
niters = 10000 niters = 10000
for _ in range(niters): for _ in range(niters):