Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raising a subproblem in SFI fails when it is used multiple times #722

Open
wkretschmer opened this issue Aug 21, 2017 · 0 comments
Open

Comments

@wkretschmer
Copy link
Contributor

Consider the following model:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant