Ratios now work out!
parent
bcf8a9ddfd
commit
96b6895a60
|
|
@ -114,7 +114,7 @@ class TestHybridGaussianFactorGraph(GtsamTestCase):
|
||||||
bayesNet.addGaussian(prior_on_x0)
|
bayesNet.addGaussian(prior_on_x0)
|
||||||
|
|
||||||
# Add prior on mode.
|
# Add prior on mode.
|
||||||
bayesNet.emplaceDiscrete(mode, "1/1")
|
bayesNet.emplaceDiscrete(mode, "6/4")
|
||||||
|
|
||||||
return bayesNet
|
return bayesNet
|
||||||
|
|
||||||
|
|
@ -216,10 +216,10 @@ class TestHybridGaussianFactorGraph(GtsamTestCase):
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
other = bayesNet.sample()
|
other = bayesNet.sample()
|
||||||
other.update(measurements)
|
other.update(measurements)
|
||||||
# print(other)
|
|
||||||
ratio = self.calculate_ratio(bayesNet, fg, other)
|
ratio = self.calculate_ratio(bayesNet, fg, other)
|
||||||
# print(f"Ratio: {ratio}\n")
|
# print(f"Ratio: {ratio}\n")
|
||||||
# self.assertAlmostEqual(ratio, expected_ratio)
|
if (ratio > 0):
|
||||||
|
self.assertAlmostEqual(ratio, expected_ratio)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue