From 06626854ca893b44c128ca333fb5623591134746 Mon Sep 17 00:00:00 2001 From: Cathy Yeh Date: Fri, 8 Dec 2017 16:01:37 -0800 Subject: tests for belief propagation with AND and mixed AND and OR nodes --- beliefs/factors/bernoulli_or_cpd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'beliefs') diff --git a/beliefs/factors/bernoulli_or_cpd.py b/beliefs/factors/bernoulli_or_cpd.py index bfb3a95..162e156 100644 --- a/beliefs/factors/bernoulli_or_cpd.py +++ b/beliefs/factors/bernoulli_or_cpd.py @@ -25,7 +25,7 @@ class BernoulliOrCPD(TabularCPD): @property def values(self): - if not any(self._values): + if len(self._values) == 0: self._values = self._build_kwise_values_array(len(self.variables)) self._values = self._values.reshape(self.cardinality) return self._values -- cgit v1.2.3