-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Currently, the output of the following code is a bit counterintuitive:
stg = AsynchronousPerturbationGraph(bn)
for color in stg.mk_unit_colors():
color.instantiate(bn)
This code fails, because the stg does not actually use bn, but rather a version of bn where all implicit parameters are replaced with explicit parameters, and perturbation parameters are added. We can access this network using stg.unperturbed_network(), but the way the API is designed right now, users don't know this.
Furthermore, with the current implementation of instantiate, it is in general not clear whether it only accepts the network which was used to create the graph, or whether it accepts any network.
However, accepting any network is problematic, because for implicit parameters, we can't reconstruct the regulator ordering based on the symbolic representation along. So I guess we can't accept arbitrary networks anyway.
Low effort solution: Add a note to the error message that if you are using a perturbation graph, you need to use unperturbed_network.
High effort solution: Only allow creating the perturbation graph using networks that don't have implicit parameters (and make the normalization function publicly available). Maybe we should make those normalization methods public anyway?