Skip to content

Instantly share code, notes, and snippets.

@palashahuja
Created March 6, 2015 09:40
Show Gist options
  • Save palashahuja/e6dd41c31a52f588fa0d to your computer and use it in GitHub Desktop.
Save palashahuja/e6dd41c31a52f588fa0d to your computer and use it in GitHub Desktop.
let's start with this ...
if evidence:
for evidence_var in evidence:
for factor in working_factors[evidence_var]:
factor_reduced = factor.reduce('{evidence_var}_{state}'.format(evidence_var=evidence_var,
state=evidence[evidence_var]),
inplace=False)
for var in factor_reduced.scope():
working_factors[var].remove(factor)
working_factors[var].add(factor_reduced)
del working_factors[evidence_var]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment