Skip to content

Only add edges in factor Tree when node is connected in BN

Jan Pöppel requested to merge jpoeppel:factorBug into master

Created by: jpoeppel

This PR fixes a small error that nodes that have not been connected in the BN (therefore useless nodes) where still connected to the resulting factortree. While this did not really cause an issue when that node contained a valid CPT, it did cause a FloatingPointError: divide by zero encountered in true_divide error, when the CPT of the unconnected node was not set upon setting evidence/message passing.

Fixes #21 (closed)

Merge request reports