You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val f = (b: Boolean) => Select(0.5 -> b, 0.5 -> !b).map(x => if(x) 1 else 0)
val e1 = Chain(Flip(0.5), f)
val e2 = Chain(Flip(0.5), f)
val e3 = e1 === e2
val alg = FlatVE(e3)
alg.start()
println(alg.probability(e3, true))
alg.kill()
This incorrectly reports that the probability that e1 and e2 are equal is 0.75 (it should be 0.5). The reason for this is that the variable for the Select is the same in corresponding subproblems of e1 and e2. So, when we "flatten" the model, the same variable gets used twice, even though the two variables should be different. Recall that our code replaces the target variable of a subproblem through the use of formal variables and actualSubproblemVariables in ChainComponent. The code here breaks because we only replace the targets; in fact we need to replace all such variables.
What happens when one of the variables is a global with respect to a subproblem? Or, a global with respect to the current problem? A solution must address both of these cases.
Running StructuredVE instead of FlatVE returns the correct answer, so this is only a problem with strategies that raise reused subproblems.
The text was updated successfully, but these errors were encountered:
Consider the following model:
This incorrectly reports that the probability that e1 and e2 are equal is 0.75 (it should be 0.5). The reason for this is that the variable for the Select is the same in corresponding subproblems of e1 and e2. So, when we "flatten" the model, the same variable gets used twice, even though the two variables should be different. Recall that our code replaces the target variable of a subproblem through the use of formal variables and actualSubproblemVariables in ChainComponent. The code here breaks because we only replace the targets; in fact we need to replace all such variables.
What happens when one of the variables is a global with respect to a subproblem? Or, a global with respect to the current problem? A solution must address both of these cases.
Running StructuredVE instead of FlatVE returns the correct answer, so this is only a problem with strategies that raise reused subproblems.
The text was updated successfully, but these errors were encountered: